Bases: fs.Entry
Copy this file to another file or directory. If other is a directory, this file is copied into it, otherwise this file is copied over it.
Parameters: |
|
---|---|
Returns: | File object representing other |
Create this file optionally with specific security. If the file already exists it will not be overwritten.
Parameters: | security – a security.Security object |
---|---|
Returns: | this object |
Delete this file
Returns: | self |
---|
Is this file equal in size, dates and attributes to another. if compare_contents is True, use filecmp to compare the contents of the files.
Parameters: | other – anything accepted by file() |
---|---|
Compare_contents : | |
True to compare contents, False otherwise | |
Returns: | True if the files are equal in size, modification date, attributes and contents |
Create this file as a hard link from other
Parameters: | other – anything accepted by file() |
---|---|
Returns: | this File object |
Create other as a hard link to this file.
Parameters: | other – anything accepted by file() |
---|---|
Returns: | File object corresponding to other |
EXPERIMENTAL: Use the codecs.open function to open this file as a Python file object. Positional and keyword arguments are passed straight through to the codecs function.
Parameters: |
|
---|
Create this file optionally with specific security. If the file already exists it will not be overwritten.
Parameters: | security – a security.Security object |
---|---|
Returns: | this object |
Zip the file up into a zipfile. By default, the zipfile will have the name of the file with ”.zip” appended and will be a sibling of the file. Also by default a new zipfile will be created, overwriting any existing one, and standard compression will be used. The filename will be stored without any directory information.
A different zipfile can be specific as the zip_filename parameter, and this can be appended to (if it exists) by specifying “a” as the mode param.
Parameters: |
|
---|---|
Returns: | a File object corresponding to the zipfile created |