[table of contents] [master index] [functions] [scripts] [methods] [modules] [classes]
MODULE
file_util
PURPOSE
Utility functions for manipulating files and paths
FUNCTION
relative_path(path1,path2)
PURPOSE
Generates relative path of path2 relative to path1.
ARGUMENTS
path1 and path2 are paths relative to a common directory
RETURN
Path for file2 relative to directory containing path1
FUNCTION
chdirs(dir)
PURPOSE
Change current working directory to dir (like os.chdir), and
create dir and any necessary parents if it does not yet exist.
FUNCTION
open_w(path)
PURPOSE
Open file with specified path for writing, return file object.
Similar to built-in function open(path,'w'), except that open_w
will create any non-existent directories in the path.
RETURN
file object with specified path, opened for writing
FUNCTION
rename(old_path,new_path)
ARGUMENTS
old_path - path of file or directory to be
PURPOSE
Rename a file or directory. Similar to os.rename,but will
create any non-existent directories in the path
RETURN
file object with specified path, opened for writing