Compression tools.
This module forms an interface to the unix compression programs
compress (.Z files) gzip (.gz files) and bzip2 (.bz2 files).
|
Functions
|
|
exists filesize findfile getformat glob remove_extension split youngest
|
|
|
exists
|
exists ( filename )
Same as os.path.exists, but will find compressed files too |
|
|
filesize
|
filesize ( filename )
Get real filesize.
If the file is compressed, retrieve the size of the
uncompressed file. |
|
|
findfile
|
findfile ( filename, verbose=1 )
Look for a file with the given file name, possibly compressed.
This will return None if there is no such file, or the (modified)
name if the file was found.
If verbose=1, a message will be printed if no file is found. |
|
|
getformat
|
getformat ( filename )
Return the compression extension, if any (empty string if none) |
|
|
glob
|
glob ( pattern )
Same as glob.glob, but includes compressed files too.
Contains optimization in case pattern does not contain a / |
|
|
remove_extension
|
remove_extension ( filename )
Return the file name without any compression extension |
|
|
split
|
split ( filename )
Split a file name into a clean file name and a compression extension |
|
|
youngest
|
youngest ( pattern, exclude=() )
Same as projtls.youngest, but includes compressed files too. |
|
Classes
|
|
|