Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
termie committed Jul 29, 2014
1 parent 48a7c8a commit fdffe92
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ We don't expect it to be perfect, just better than whatever your first draft
would have been. Patches welcome.

See also: https://docs.python.org/3.5/library/shutil.html

================
Functions So Far
================

We support Copy, CopyFile, CopyMode, and CopyTree. CopyStat would be nice if
anybody wants to write that. Also the other functions that might be useful in
the python library :D
22 changes: 10 additions & 12 deletions shutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ func Copy(src, dst string, followSymlinks bool) (string, error){
return dst, nil
}


type CopyTreeOptions struct {
Symlinks bool
IgnoreDanglingSymlinks bool
Expand All @@ -213,24 +212,23 @@ type CopyTreeOptions struct {
// Recursively copy a directory tree.
//
// The destination directory must not already exist.

// If the optional symlinks flag is true, symbolic links in the
//
// If the optional Symlinks flag is true, symbolic links in the
// source tree result in symbolic links in the destination tree; if
// it is false, the contents of the files pointed to by symbolic
// links are copied. If the file pointed by the symlink doesn't
// exist, an exception will be added in the list of errors raised in
// an Error exception at the end of the copy process.
// exist, an error will be returned.
//
// You can set the optional ignoreDanglingSymlinks flag to true if you
// want to silence this exception. Notice that this has no effect on
// platforms that don't support os.symlink.
// You can set the optional IgnoreDanglingSymlinks flag to true if you
// want to silence this error. Notice that this has no effect on
// platforms that don't support os.Symlink.
//
// The optional ignore argument is a callable. If given, it
// is called with the `src` parameter, which is the directory
// being visited by copytree(), and `names` which is the list of
// being visited by CopyTree(), and `names` which is the list of
// `src` contents, as returned by ioutil.ReadDir():
//
// callable(src, names) -> ignored_names
// callable(src, entries) -> ignoredNames
//
// Since CopyTree() is called recursively, the callable will be
// called once for each directory that is copied. It returns a
Expand All @@ -240,8 +238,8 @@ type CopyTreeOptions struct {
// The optional copyFunction argument is 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, Copy() is used, but any
// function that supports the same signature (like Copy()) can be used.

// function that supports the same signature (like Copy2() when it
// exists) can be used.
func CopyTree(src, dst string, options *CopyTreeOptions) error {
if options == nil {
options = &CopyTreeOptions{Symlinks:false,
Expand Down

0 comments on commit fdffe92

Please sign in to comment.