A file object used with pdg.WorkItem inputs, outputs and file attributes.
Each file object has a platform-independent path with __PDG_DIR__ and
__PDG_TEMP__ tokens in it, a file type and a mod time.
Methods ¶
Static Methods ¶
mapPath(path, zone)
        
Static method
Returns the mapped version of the given path for the given zone.
This function is deprecated. Use pdg.PathMap.mapPath instead.
mapPathToLocal(path)
        
Static method
Returns the mapped version of the given path for the local zone.
This function is deprecated. Use pdg.PathMap.mapPathToLocal instead.
mappingZone()
        
Static method
Returns the local mapping zone.
This function is deprecated. Use pdg.PathMap.mappingzone instead.
pathMapJSON()
        
Static method
Returns the PDG Path Map as a JSON string.
This function is deprecated. Use pdg.PathMap.pathMapJSON instead.
setMappingZone(zone)
        
Static method
Sets the local mapping zone.
This function is deprecated. Use pdg.PathMap.setMappingZone instead.
setPathMapJSON(zone)
        
Static method
Sets the PDG Path Map from a JSON string.
This function is deprecated. Use pdg.PathMap.setPathMapJSON instead.
Instance Methods ¶
__init__()
        
Constructs a new, empty file object
__init__(path, own)
        
Constructs a file object with the specified name and ownership flag. Own
    should be set to True if the file was produced by the work item that will
    hold the File object.
The tag and modtime for the File are computed automatically by PDG.
__init__(path, tag, modtime, own)
        
Constructs a file object with the specified name, tag, modtime and own
    flag. Own should be set to True if the file was produced by the work item
    that will hold the File object.
asTuple()
  → tuple
        
Returns a tuple containing the (path, tag, hash, own) values for this file object.
localizePath(scheduler)
  → str
        
Localizes the path stored in this file object using the specified scheduler.
updateStat(work_item=None, force=false)
        
Updates the hash and size of the file using any Custom File Stat Handlers that have been set, or by stat-ing the file directly if no handlers are installed.
DefaultArchiveTag
 : str
        
Static method Property
The file tag used for archives.
DefaultCsvTag
 : str
        
Static method Property
The file tag used for CSV files.
DefaultDirTag
 : str
        
Static method Property
The file tag used for directories.
DefaultFileTag
 : str
        
Static method Property
The file tag used for file paths that don’t have a particular file type.
DefaultGeoTag
 : str
        
Static method Property
The file tag used for file paths that don’t have a particular file type.
DefaultHdaTag
 : str
        
Static method Property
The file tag used for HDA files.
DefaultHipTag
 : str
        
Static method Property
The file tag used for hip files.
DefaultImageTag
 : str
        
Static method Property
The file tag used for images.
DefaultPythonScriptTag
 : str
        
Static method Property
The file tag used for Python scripts.
DefaultSymLinkTag
 : str
        
Static method Property
The file tag used for sym links.
DefaultTxtTag
 : str
        
Static method Property
The file tag used for plain text files.
DefaultUsdTag
 : str
        
Static method Property
The file tag used for USD files.
DefaultVideoTag
 : str
        
Static method Property
The file tag used for USD files.
path
 : str
        
Property
The path stored by the file object when it was created.
local_path
 : str
        
Property
The path stored by the file object, mapped to the local zone.
tag
 : str
        
Property
The file type tag associated with the file.
hash
 : int
        
Property
May hold the modtime or hash of the file.
owned
 : bool
        
Property
Whether or not the file is owned by the work item that holds this object.
size
 : int
        
Property
The size of the file on disk.
type
 : pdg.fileType
        
Property
The type of the file, e.g. if it was added when the work item generatd or when the work item cooked.