Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
1fd64821
Kaydet (Commit)
1fd64821
authored
Şub 13, 2012
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
shutil copy module reference doc fix.
üst
610a0b67
7f728c1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
shutil.rst
Doc/library/shutil.rst
+23
-21
No files found.
Doc/library/shutil.rst
Dosyayı görüntüle @
1fd64821
...
...
@@ -21,8 +21,8 @@ copying and removal. For operations on individual files, see also the
.. warning::
Even the higher-level file copying functions (:func:`
copy`, :func:`copy2`)
cannot copy all file metadata.
Even the higher-level file copying functions (:func:`
shutil.copy`,
:func:`shutil.copy2`)
cannot copy all file metadata.
On POSIX platforms, this means that file owner and group are lost as well
as ACLs. On Mac OS, the resource fork and other metadata are not used.
...
...
@@ -49,10 +49,11 @@ Directory and files operations
.. function:: copyfile(src, dst[, symlinks=False])
Copy the contents (no metadata) of the file named *src* to a file named *dst*.
*dst* must be the complete target file name; look at :func:`copy` for a copy that
accepts a target directory path. If *src* and *dst* are the same files,
:exc:`Error` is raised.
Copy the contents (no metadata) of the file named *src* to a file named
*dst*. *dst* must be the complete target file name; look at
:func:`shutil.copy` for a copy that accepts a target directory path. If
*src* and *dst* are the same files, :exc:`Error` is raised.
The destination location must be writable; otherwise, an :exc:`OSError` exception
will be raised. If *dst* already exists, it will be replaced. Special files
such as character or block devices and pipes cannot be copied with this
...
...
@@ -101,10 +102,11 @@ Directory and files operations
.. function:: copy2(src, dst[, symlinks=False])
Similar to :func:`copy`, but metadata is copied as well -- in fact, this is just
:func:`copy` followed by :func:`copystat`. This is similar to the
Unix command :program:`cp -p`. If *symlinks* is true, symbolic links won't
be followed but recreated instead -- this resembles GNU's :program:`cp -P`.
Similar to :func:`shutil.copy`, but metadata is copied as well -- in fact,
this is just :func:`shutil.copy` followed by :func:`copystat`. This is
similar to the Unix command :program:`cp -p`. If *symlinks* is true,
symbolic links won't be followed but recreated instead -- this resembles
GNU's :program:`cp -P`.
.. versionchanged:: 3.3
Added *symlinks* argument.
...
...
@@ -119,10 +121,10 @@ Directory and files operations
.. function:: copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False)
Recursively copy an entire directory tree rooted at *src*. The destination
directory, named by *dst*, must not already exist; it will be created as
well
as missing parent directories. Permissions and times of directories are
copied with :func:`copystat`, individual files are copied using
:func:`copy2`.
directory, named by *dst*, must not already exist; it will be created as
well as missing parent directories. Permissions and times of directories
are
copied with :func:`copystat`, individual files are copied using
:func:`
shutil.
copy2`.
If *symlinks* is true, symbolic links in the source tree are represented as
symbolic links in the new tree and the metadata of the original links will
...
...
@@ -148,10 +150,10 @@ Directory and files operations
If exception(s) occur, an :exc:`Error` is raised with a list of reasons.
If *copy_function* is given, it must be a callable that will be used
to copy each file. It will be called with the source path and the
destination path as arguments. By default, :func:`copy2` is used, but any
function that supports the same signature (like :func:`
copy`) can be used.
If *copy_function* is given, it must be a callable that will be used
to copy
each file. It will be called with the source path and the destination path
as arguments. By default, :func:`shutil.copy2` is used, but any function
that supports the same signature (like :func:`shutil.
copy`) can be used.
.. versionchanged:: 3.2
Added the *copy_function* argument to be able to provide a custom copy
...
...
@@ -197,9 +199,9 @@ Directory and files operations
:func:`os.rename` semantics.
If the destination is on the current filesystem, then :func:`os.rename` is
used. Otherwise, *src* is copied (using :func:`
copy2`) to *dst* and then
removed. In case of symlinks, a new symlink pointing to the target of *src*
will be created in or as *dst* and *src* will be removed.
used. Otherwise, *src* is copied (using :func:`
shutil.copy2`) to *dst* and
then removed. In case of symlinks, a new symlink pointing to the target of
*src*
will be created in or as *dst* and *src* will be removed.
.. versionchanged:: 3.3
Added explicit symlink handling for foreign filesystems, thus adapting
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment