You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/guide.rst
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ Calling :meth:`fs.base.FS.tree` on a FS object will give you a nice ASCII repres
69
69
Closing Filesystems
70
70
~~~~~~~~~~~~~~~~~~~
71
71
72
-
Closing a filesystem may be an alien concept if you are accustomed to using the Python standard library, but FS objects have a ``close`` method (:meth:`fs.base.FS.close`) which will perform any required clean-up actions. For many filesystems (notably :class:`fs.osfs.OSFS`), the close method does very little, but other filesystems may only finalize files or release resources once ``close()`` is called.
72
+
FS objects have a ``close`` method (:meth:`fs.base.FS.close`) which will perform any required clean-up actions. For many filesystems (notably :class:`fs.osfs.OSFS`), the ``close`` method does very little, but other filesystems may only finalize files or release resources once ``close()`` is called.
73
73
74
74
You can call ``close`` explicitly once you are finished using a filesystem. For example::
75
75
@@ -166,10 +166,17 @@ Moving and Copying
166
166
167
167
You can move and copy file contents with :meth:`fs.base.FS.move` and :meth:`fs.base.FS.copy` methods, and the equivalent :meth:`fs.base.FS.movedir` and :meth:`fs.base.FS.copydir` methods which operate on directories rather than files.
168
168
169
-
These move and copy methods are optimized where possible, and depending on the implementation, they may be more performant than reading and writing open files.
169
+
These move and copy methods are optimized where possible, and depending on the implementation, they may be more performant than reading and writing files.
170
170
171
-
To move and/or copy files *between* filesystems (as apposed to within the same filesystem), use the :mod:`fs.move` and :mod:`fs.copy` modules. The methods in these modules accept both FS objects and FS URLS, which can make for quite elegant code. For instance, the following will compress the contents of your projects folder::
171
+
To move and/or copy files *between* filesystems (as apposed to within the same filesystem), use the :mod:`fs.move` and :mod:`fs.copy` modules. The methods in these modules accept both FS objects and FS URLS. For instance, the following will compress the contents of your projects folder::
172
172
173
173
>>> from fs.copy import copy_fs
174
174
>>> copy_fs('~/projects', 'zip://projects.zip')
175
175
176
+
Which is the equivalent to this, more verbose, code:::
0 commit comments