Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: os.remove - Function Up: os - Tool Previous: os.copy - Function


os.move - Function



Package utility
Module misc
Tool os


move a file, directory, or symlink


Synopsis
move(source, target, overwrite, follow)


Description
Move a file, directory (recursively), or symbolic link. It can also move across file systems.
If the source is a directory, the entire directory (including all subdirectories) is moved (similar to UNIX command mv). However, unlike that UNIX command the source directory itself is not moved. Only its contents are moved.
If the source is a file or symlink and the target is a directory, the source is moved to that directory (similar to UNIX command mv).

By default a source symbolic link is followed. In that case the symbolic link is not moved, but the file or directory it links to.

An error is given if the target already exists, unless overwrite=T. In that case the target will be removed first.



Example
This command moves the entire MeasurementSet to /aips++2/gvandiep. Note that the name of the MeasurementSet has to be given in the target.
  dos.move ('/aips++2/gvandiep/hol.ms', '~/aips++/test/hol.ms')



Arguments

source in path name of source
    Allowed: string
target in path name of target
    Allowed: string
overwrite in overwrite if target exists?
    Allowed: bool
    Default: F
follow in follow symlink?
    Allowed: bool
    Default: T


Returns
T or fail




next up previous contents index
Next: os.remove - Function Up: os - Tool Previous: os.copy - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15