Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note to the docstrings differentiating cp function from cp command #41761

Merged
merged 1 commit into from
Aug 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions base/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,13 @@ If `follow_symlinks=false`, and `src` is a symbolic link, `dst` will be created
symbolic link. If `follow_symlinks=true` and `src` is a symbolic link, `dst` will be a copy
of the file or directory `src` refers to.
Return `dst`.

!!! note
thazhemadam marked this conversation as resolved.
Show resolved Hide resolved
The `cp` function is different from the `cp` command. The `cp` function always operates on
the assumption that `dst` is a file, while the command does different things depending
on whether `dst` is a directory or a file.
Using `force=true` when `dst` is a directory will result in loss of all the contents present
in the `dst` directory, and `dst` will become a file that has the contents of `src` instead.
"""
function cp(src::AbstractString, dst::AbstractString; force::Bool=false,
follow_symlinks::Bool=false)
Expand Down