mirror of https://github.com/flaggo/pydu.git
Merge pull request #9 from focalism/master
Modify some description for file in docs
This commit is contained in:
commit
8bd61a13d8
|
@ -15,17 +15,16 @@ File
|
|||
Traceback (most recent call last):
|
||||
... OSError: Create dir: test1 error.
|
||||
|
||||
|
||||
.. py:function:: pydu.file.remove(path, mode=0o755, ignore_errors=False, onerror)
|
||||
|
||||
Remove a file or directory.
|
||||
|
||||
If ``ignore_errors`` is set, errors are ignored; otherwise, if onerror
|
||||
is set, it is called to handle the error with arguments (func,
|
||||
path, exc_info) where func is platform and implementation dependent;
|
||||
path is the argument to that function that caused it to fail; and
|
||||
exc_info is a tuple returned by sys.exc_info(). If ``ignore_errors``
|
||||
is False and onerror is None, an exception is raised.
|
||||
If ``ignore_errors`` is set, errors are ignored; otherwise, if `onerror`
|
||||
is set, it is called to handle the error with arguments (`func` ,
|
||||
`path` , `exc_info` ) where func is platform and implementation dependent;
|
||||
`path` is the argument to that function that caused it to fail; and
|
||||
`exc_info` is a tuple returned by `sys.exc_info()`. If `ignore_errors`
|
||||
is `False` and `onerror` is None, an exception is raised.
|
||||
|
||||
>>> from pydu.file import makedirs
|
||||
>>> from pydu.file import remove
|
||||
|
@ -75,8 +74,6 @@ File
|
|||
symlink will be created instead of copying the file it points to,else
|
||||
the contents of the file pointed to by symbolic links is copied.
|
||||
|
||||
Example: Copy a symlink
|
||||
|
||||
>>> from pydu.file import copy,symlink
|
||||
>>> from pydu.file import makedirs,open_fle
|
||||
>>> open_fle('test/test.txt')
|
||||
|
@ -104,7 +101,7 @@ File
|
|||
|
||||
``link`` only work on `Unix-like` system, it create a hard link pointing to
|
||||
source named link_name.If dist is exist and overwrite is true,a
|
||||
new symlink will be created.
|
||||
new link will be created.
|
||||
|
||||
>>> from pydu.file import link
|
||||
>>> link('test.txt','test.link')
|
||||
|
|
Loading…
Reference in New Issue