Lists the contents of the specified path, returning a 2-tuple of lists This method if that’s not appropriate for your storage. The default implementation uses os.path operations. Will be prepended back to the resulting name. In that case, the path won’t be passed to get_valid_name() but The filename argument may include a path as returned by Returns a filename to be passed to the save() method. Validates the filename by calling get_valid_name() and Returns a filename based on the name parameter that’s suitableįor use on the target storage system. Otherwise returns a naive datetime in the local timezone. For storage systems unable to return the last modified time this Returns a datetime of the last modified time of theįile. Returns a datetime of the creation time of the file.įor storage systems unable to return the creation time this will raise If a file with name already exists, get_alternative_name() isĬalled to obtain an alternative name. SuspiciousFileOperation exception will be raised. ![]() If a free unique filename cannot be found, a The length of the filename will not exceed max_length, if provided. Returns a filename based on the name parameter that’s free andĪvailable for new content to be written to on the target storage get_available_name( name, max_length = None) ¶ Returns an alternative filename based on the file_root andįile_ext parameters, an underscore plus a random 7 characterĪlphanumeric string is appended to the filename before the extension. get_alternative_name( file_root, file_ext) ¶ ![]() If USE_TZ is True, returns an aware datetime, For storage systems unable to return the last accessed time this Returns a datetime of the last accessed time of theįile. In the storage system, or False if the name is available for a new Returns True if a file referenced by the given name already exists On the target storage system this will raise NotImplementedError delete( name) ¶ĭeletes the file referenced by name. Used will be the current value of os.environ note that this ![]() When methods return naive datetime objects, the effective timezone
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |