Package perforce :: Module api :: Class FileSys
[frames] | no frames]

Class FileSys



object --+
         |
        FileSys

A file system object.

Used by Perforce for reading from and writing to files on the local machine.


See Also: perforce.api.ClientUser.diff, perforce.api.ClientUser.merge

Instance Methods
 
__new__(T, S, ...)
Returns: a new object with type S, a subtype of T
 
close(error)
Close the file, flushing any buffered data.
 
getType()
Returns: FileSysType
 
isExec()
Returns: boolean
 
isTextual()
Returns: boolean
 
isUnicode()
Returns: boolean
 
open(mode, error)
Opens the file system object for the specified mode.
 
path()
Returns: str or unicode
 
read(len, error)
Read some data from the file, returning it as a string.
 
set(name)
Set the path to this file system object.
 
write(data, error)
Write some data to the file.

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__new__(T, S, ...)

 
Returns:
a new object with type S, a subtype of T

Overrides: object.__new__

close(error)

 
Close the file, flushing any buffered data.
Parameters:
  • error (perforce.api.Error) - An error object that receives any errors that occurred when closing the file.
Returns:
None

getType()

 
Returns:
FileSysType

isExec()

 
Returns:
boolean

See Also: getType

isTextual()

 
Returns:
boolean

See Also: getType

isUnicode()

 
Returns:
boolean

See Also: getType

open(mode, error)

 
Opens the file system object for the specified mode.
Parameters:
Returns:
None

path()

 
Returns:
str or unicode

See Also: set()

read(len, error)

 
Read some data from the file, returning it as a string.
Parameters:
  • len (int) - The number of bytes to read form the file.
  • error (perforce.api.Error) - An error object that receives any errors that occurred when reading from the file.
Returns:
str

set(name)

 
Set the path to this file system object.
Parameters:
  • name (str or unicode) - The path of the file.
Returns:
None

write(data, error)

 
Write some data to the file.
Parameters:
  • data (str) - The byte data to be written to the file.
  • error (perforce.api.Error) - An error object that receives any errors that occurred when writing to the file.
Returns:
None