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
If src has nested directories and the dst is an S3Path, we get errors since we are missing final /s when we readdir a local directory and get the names.
We could modify cp to insert /s as needed:
function Base.cp(src::AbstractPath, dst::AbstractPath; force=false, follow_symlinks=false)
ifexists(dst)
if force
rm(dst; force=force, recursive=true)
elsethrow(ArgumentError("Destination already exists: $dst"))
endendif!exists(src)
throw(ArgumentError("Source path does not exist: $src"))
elseifisdir(src)
mkdir(dst)
for fp inreaddir(src)
src_fp = src / fp
dst_fp = dst / fp
ifisdir(src_fp) &&!endswith(dst_fp, "/")
dst_fp *="/"endcp(src_fp, dst_fp; force=force)
endelseifisfile(src)
write(dst, read(src))
elseifislink(src)
follow_symlinks ?symlink(readlink(src), dst) :write(dst, read(FilePathsBase.canonicalize(src)))
elsethrow(ArgumentError("Source path is not a file or directory: $src"))
endreturn dst
end
If
src
has nested directories and thedst
is anS3Path
, we get errors since we are missing final/
s when wereaddir
a local directory and get the names.We could modify
cp
to insert/
s as needed:Transferred from rofinn/FilePathsBase.jl#128
The text was updated successfully, but these errors were encountered: