ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference
ActivePython 2.4
Python Documentation
Distributing Python Modules
10. API Reference
10.1 distutils.core -- Core Distutils functionality
10.2 distutils.ccompiler -- CCompiler base class
10.3 distutils.unixccompiler -- Unix C Compiler
10.4 distutils.msvccompiler -- Microsoft Compiler
10.5 distutils.bcppcompiler -- Borland Compiler
10.6 distutils.cygwincompiler -- Cygwin Compiler
10.7 distutils.emxccompiler -- OS/2 EMX Compiler
10.8 distutils.mwerkscompiler -- Metrowerks CodeWarrior support
10.9 distutils.archive util -- Archiving utilities
10.10 distutils.dep util -- Dependency checking
10.11 distutils.dir util -- Directory tree operations
10.12 distutils.file util -- Single file operations
10.13 distutils.util -- Miscellaneous other utility functions
10.14 distutils.dist -- The Distribution class
10.15 distutils.extension -- The Extension class
10.16 distutils.debug -- Distutils debug mode
10.17 distutils.errors -- Distutils exceptions
10.18 distutils.fancy getopt -- Wrapper around the standard getopt module
10.19 distutils.filelist -- The FileList class
10.20 distutils.log -- Simple PEP 282-style logging
10.21 distutils.spawn -- Spawn a sub-process
10.22 distutils.sysconfig -- System configuration information
10.23 distutils.text file -- The TextFile class
10.24 distutils.version -- Version number classes
10.25 distutils.cmd -- Abstract base class for Distutils commands
10.26 distutils.command -- Individual Distutils commands
10.27 distutils.command.bdist -- Build a binary installer
10.28 distutils.command.bdist packager -- Abstract base class for packagers
10.29 distutils.command.bdist dumb -- Build a ``dumb'' installer
10.30 distutils.command.bdist rpm -- Build a binary distribution as a Redhat RPM and SRPM
10.31 distutils.command.bdist wininst -- Build a Windows installer
10.32 distutils.command.sdist -- Build a source distribution
10.33 distutils.command.build -- Build all files of a package
10.34 distutils.command.build clib -- Build any C libraries in a package
10.35 distutils.command.build ext -- Build any extensions in a package
10.36 distutils.command.build py -- Build the .py/.pyc files of a package
10.37 distutils.command.build scripts -- Build the scripts of a package
10.38 distutils.command.clean -- Clean a package build area
10.39 distutils.command.config -- Perform package configuration
10.40 distutils.command.install -- Install a package
10.41 distutils.command.install data -- Install data files from a package
10.42 distutils.command.install headers -- Install C/C++ header files from a package
10.43 distutils.command.install lib -- Install library files from a package
10.44 distutils.command.install scripts -- Install script files from a package
10.45 distutils.command.register -- Register a module with the Python Package Index
10.46 Creating a new Distutils command

MyASPN >> Reference >> ActivePython 2.4 >> Python Documentation >> Distributing Python Modules >> 10. API Reference
ActivePython 2.4 documentation

10.12 distutils.file_util -- Single file operations

This module contains some utility functions for operating on individual files.

copy_file( src, dst[preserve_mode=1, preserve_times=1, update=0, link=None, verbose=0, dry_run=0])
Copy file src to dst. If dst is a directory, then src is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If preserve_mode is true (the default), the file's mode (type and permission bits, or whatever is analogous on the current platform) is copied. If preserve_times is true (the default), the last-modified and last-access times are copied as well. If update is true, src will only be copied if dst does not exist, or if dst does exist but is older than src.

link allows you to make hard links (using os.link) or symbolic links (using os.symlink) instead of copying: set it to 'hard' or 'sym'; if it is None (the default), files are copied. Don't set link on systems that don't support it: copy_file() doesn't check if hard or symbolic linking is available. It uses _copy_file_contents() to copy file contents.

Return a tuple "(dest_name, copied)": dest_name is the actual name of the output file, and copied is true if the file was copied (or would have been copied, if dry_run true).

move_file( src, dst[verbose, dry_run])
Move file src to dst. If dst is a directory, the file will be moved into it with the same name; otherwise, src is just renamed to dst. Returns the new full name of the file. Warning: Handles cross-device moves on Unix using copy_file(). What about other systems???

write_file( filename, contents)
Create a file called filename and write contents (a sequence of strings without line terminators) to it.

See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved