[table of contents] [master index] [functions] [scripts] [methods] [modules] [classes]

### TABLE OF CONTENTS

- module file_util

- function relative_path
- function chdirs
- function open_w
- function rename

## file_util

MODULE

        file_util

PURPOSE

        Utility functions for manipulating files and paths

## relative_path

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

## chdirs

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.

## open_w

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

## rename

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