Trees | Indices | Help |
|
---|
|
Utility functions for copying files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
|
|||
Error |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Imports: os, sys, stat, abspath
|
Copy data and mode bits ("cp src dst"). The destination may be a directory. |
Copy data and all stat info ("cp -p src dst"). The destination may be a directory. |
Recursively copy a directory tree using copy2(). The destination directory must not already exist. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. XXX Consider this example code rather than the ultimate tool. |
Recursively delete a directory tree. If ignore_errors is set, errors are ignored; otherwise, if onerror is set, it is called to handle the error with arguments (func, path, exc_info) where func is os.listdir, os.remove, or os.rmdir; path is the argument to that function that caused it to fail; and exc_info is a tuple returned by sys.exc_info(). If ignore_errors is false and onerror is None, an exception is raised. |
Recursively move a file or directory to another location. If the destination is on our current filesystem, then simply use rename. Otherwise, copy src to the dst and then remove src. A lot more could be done here... A look at a mv.c shows a lot of the issues this implementation glosses over. |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jun 13 23:36:19 2008 | http://epydoc.sourceforge.net |