On Windows, file owners, ACLs and alternate data streamsĪre not copied. copyfileobj ( fsrc, fdst ) ¶Ĭopy the contents of the file-like object fsrc to the file-like object fdst. The integer length, if given, is the buffer size. Length value means to copy the data without looping over the source data inĬhunks by default the data is read in chunks to avoid uncontrolled memoryĬonsumption. Note that if the current file position of the fsrc object is notĠ, only the contents from the current file position to the end of the file willīe copied. copyfile ( src, dst, *, follow_symlinks = True ) ¶Ĭopy the contents (no metadata) of the file named src to a file namedĭst and return dst in the most efficient way possible. Src and dst are path-like objects or path names given as strings.ĭst must be the complete target file name look at copy()įor a copy that accepts a target directory path. Specify the same file, SameFileError is raised. The destination location must be writable otherwise, an OSErrorĮxception will be raised. If follow_symlinks is false and src is a symbolic link,Ī new symbolic link will be created instead of copying the Special files such as character or block devices and pipes cannot be If dst already exists, it will be replaced. Raises an auditing event pyfile with arguments src, dst.Ĭhanged in version 3.3: Added follow_symlinks argument and support for Linux extended attributes. copy ( src, dst, *, follow_symlinks = True ) ¶Ĭopies the file src to the file or directory dst. If dst specifies a file that already exists, Ifĭst specifies a directory, the file will be copied into dst using theīase filename from src. Returns the path to the newly created file. If follow_symlinks is false, and src is a symbolic link,ĭst will be created as a symbolic link.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |