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

def paramiko::sftp_si::SFTPServerInterface::list_folder (   self,
  path 
)

Return a list of files within a given folder.  The C{path} will use
posix notation (C{"/"} separates folder names) and may be an absolute
or relative path.

The list of files is expected to be a list of L{SFTPAttributes}
objects, which are similar in structure to the objects returned by
C{os.stat}.  In addition, each object should have its C{filename}
field filled in, since this is important to a directory listing and
not normally present in C{os.stat} results.  The method
L{SFTPAttributes.from_stat} will usually do what you want.

In case of an error, you should return one of the C{SFTP_*} error
codes, such as L{SFTP_PERMISSION_DENIED}.

@param path: the requested path (relative or absolute) to be listed.
@type path: str
@return: a list of the files in the given folder, using
    L{SFTPAttributes} objects.
@rtype: list of L{SFTPAttributes} I{or error code}

@note: You should normalize the given C{path} first (see the
C{os.path} module) and check appropriate permissions before returning
the list of files.  Be careful of malicious clients attempting to use
relative paths to escape restricted folders, if you're doing a direct
translation from the SFTP server path to your local filesystem.

Definition at line 109 of file sftp_si.py.

00109                                :
        """
        Return a list of files within a given folder.  The C{path} will use
        posix notation (C{"/"} separates folder names) and may be an absolute
        or relative path.

        The list of files is expected to be a list of L{SFTPAttributes}
        objects, which are similar in structure to the objects returned by
        C{os.stat}.  In addition, each object should have its C{filename}
        field filled in, since this is important to a directory listing and
        not normally present in C{os.stat} results.  The method
        L{SFTPAttributes.from_stat} will usually do what you want.

        In case of an error, you should return one of the C{SFTP_*} error
        codes, such as L{SFTP_PERMISSION_DENIED}.

        @param path: the requested path (relative or absolute) to be listed.
        @type path: str
        @return: a list of the files in the given folder, using
            L{SFTPAttributes} objects.
        @rtype: list of L{SFTPAttributes} I{or error code}
        
        @note: You should normalize the given C{path} first (see the
        C{os.path} module) and check appropriate permissions before returning
        the list of files.  Be careful of malicious clients attempting to use
        relative paths to escape restricted folders, if you're doing a direct
        translation from the SFTP server path to your local filesystem.
        """
        return SFTP_OP_UNSUPPORTED

    def stat(self, path):


Generated by  Doxygen 1.6.0   Back to index