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.move - Function Up: os - Tool Previous: os.freespace - Function


os.copy - Function



Package utility
Module misc
Tool os


copy a file, directory, or symlink


Synopsis
copy(source, target, overwrite, follow)


Description
Copy a file, directory (recursively), or symbolic link.
If the source is a directory, the entire directory (including all subdirectories) is copied (similar to UNIX command cp -r). However, unlike that UNIX command the source directory itself is not copied. Only its contents are copied.
If the source is a file or symlink and the target is a directory, the source is copied to that directory (similar to UNIX command cp).

By default a source symbolic link is followed. In that case the symbolic link is not copied, 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 copies the entire MeasurementSet to /aips++2/gvandiep. Note that the name of the MeasurementSet has to be given in the target.
  dos.copy ('~/aips++/test/hol.ms', '/aips++2/gvandiep/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.move - Function Up: os - Tool Previous: os.freespace - 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