Logo Search packages:      
Sourcecode: paramiko version File versions  Download package

def paramiko::sftp_si::SFTPServerInterface::open (   self,
  path,
  flags,
  attr 
)

Open a file on the server and create a handle for future operations
on that file.  On success, a new object subclassed from L{SFTPHandle}
should be returned.  This handle will be used for future operations
on the file (read, write, etc).  On failure, an error code such as
L{SFTP_PERMISSION_DENIED} should be returned.

C{flags} contains the requested mode for opening (read-only,
write-append, etc) as a bitset of flags from the C{os} module:
    - C{os.O_RDONLY}
    - C{os.O_WRONLY}
    - C{os.O_RDWR}
    - C{os.O_APPEND}
    - C{os.O_CREAT}
    - C{os.O_TRUNC}
    - C{os.O_EXCL}
(One of C{os.O_RDONLY}, C{os.O_WRONLY}, or C{os.O_RDWR} will always
be set.)

The C{attr} object contains requested attributes of the file if it
has to be created.  Some or all attribute fields may be missing if
the client didn't specify them.

@note: The SFTP protocol defines all files to be in "binary" mode.
    There is no equivalent to python's "text" mode.

@param path: the requested path (relative or absolute) of the file
    to be opened.
@type path: str
@param flags: flags or'd together from the C{os} module indicating the
    requested mode for opening the file.
@type flags: int
@param attr: requested attributes of the file if it is newly created.
@type attr: L{SFTPAttributes}
@return: a new L{SFTPHandle} I{or error code}.
@rtype L{SFTPHandle}

Definition at line 69 of file sftp_si.py.

00069                                      :
        """
        Open a file on the server and create a handle for future operations
        on that file.  On success, a new object subclassed from L{SFTPHandle}
        should be returned.  This handle will be used for future operations
        on the file (read, write, etc).  On failure, an error code such as
        L{SFTP_PERMISSION_DENIED} should be returned.

        C{flags} contains the requested mode for opening (read-only,
        write-append, etc) as a bitset of flags from the C{os} module:
            - C{os.O_RDONLY}
            - C{os.O_WRONLY}
            - C{os.O_RDWR}
            - C{os.O_APPEND}
            - C{os.O_CREAT}
            - C{os.O_TRUNC}
            - C{os.O_EXCL}
        (One of C{os.O_RDONLY}, C{os.O_WRONLY}, or C{os.O_RDWR} will always
        be set.)

        The C{attr} object contains requested attributes of the file if it
        has to be created.  Some or all attribute fields may be missing if
        the client didn't specify them.
        
        @note: The SFTP protocol defines all files to be in "binary" mode.
            There is no equivalent to python's "text" mode.

        @param path: the requested path (relative or absolute) of the file
            to be opened.
        @type path: str
        @param flags: flags or'd together from the C{os} module indicating the
            requested mode for opening the file.
        @type flags: int
        @param attr: requested attributes of the file if it is newly created.
        @type attr: L{SFTPAttributes}
        @return: a new L{SFTPHandle} I{or error code}.
        @rtype L{SFTPHandle}
        """
        return SFTP_OP_UNSUPPORTED

    def list_folder(self, path):


Generated by  Doxygen 1.6.0   Back to index