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
Using a relative path (. or ..) in the destination path cause the file (or folder) to be uploaded but with the . and .. not "resolved". That means that on a Linux filesystem those directory become invisible: rclone mount, rclone serve doesn't show the folder, while rclone lsjson (and other ls type) does.
@fabh2o try this rclone copy file GoogleDrive:testDir/./dir1 --drive-encoding=None
Setting the encoding flag has no effect: the folder structure created is the following testDir/./dir1/file
With the remote mounted, using ls and hexdump i found out that the "dot" is a "FULLWIDTH FULL STOP" (the bytes are ef bc 8e) and not the "illegal" .
On a web browser, the created folder name seems to be a normal dot
Using rclone lsjson GoogleDrive:testDir -R -P=false| grep file | jq '.Path' | hexdump, the "dot" is the same as the one reported by using rclone mount and ls
PS, might be not relevant. I'm trying all the encoding options, seems like the Dot, LeftPeriod and the RightPeriod type create the following name ‛. (e2 80 9b ef bc 8e)
No, it's not a "normal" ASCII dot but a UTF-8 pseudographics glyph that looks like a dot but is treated like a filename character by cloud. rclone performs this and other translations provider-wise.
Let's introduce an option --normalize-path to normalize . and .. in paths before encoding
with choices always,local,off,warn,?
with local as default to turn it on by default for local storage only
?
EDIT
If you agree in general to have path normalization in addition to (before / on top) path encoding, let's open another github issue or a forum thread to discuss details. I'm asking here only to stay close to a typical use, for convenience.
Let's introduce an option --normalize-path to normalize . and .. in paths before encoding
with choices always,local,off,warn,?
with local as default to turn it on by default for local storage only
?
I wonder whether it might be backend configurable also.
I think all the backends except for the bucket based backends (s3, gcs, swift, b2, etc) would always want normalized paths. These backends have a strong concept of a filesystem with folders for which path normalization makes sense.
So maybe the selection should be always,auto,off,warn where auto looks to see if f.Features().BucketBased is set and doesn't normalize paths for those.
What do you think?
EDIT
If you agree in general to have path normalization in addition to (before / on top) path encoding, let's open another github issue or a forum thread to discuss details. I'm asking here only to stay close to a typical use, for convenience.
Activity
ncw commentedon Jan 22, 2021
Rclone works like this because on object storage systems, paths with
.and..in filenames are common.I agree it is a bit odd.
Maybe rclone should optionally normalize the paths on the command line and give a NOTICE if they aren't normalized.
fabh2o commentedon Jan 25, 2021
If it's a valid thing, should this be labelled as
new featureorenhancement?ivandeex commentedon Mar 16, 2021
@fabh2o try this
rclone copy file GoogleDrive:testDir/./dir1 --drive-encoding=Noneivandeex commentedon Mar 16, 2021
This request is similar to #4897 but this one is for cloud storage while #4897 is for local filesystem.
fabh2o commentedon Mar 16, 2021
Setting the encoding flag has no effect: the folder structure created is the following
testDir/./dir1/filelsandhexdumpi found out that the "dot" is a "FULLWIDTH FULL STOP" (the bytes areef bc 8e) and not the "illegal".rclone lsjson GoogleDrive:testDir -R -P=false| grep file | jq '.Path' | hexdump, the "dot" is the same as the one reported by using rclone mount and lsPS, might be not relevant. I'm trying all the encoding options, seems like the
Dot,LeftPeriodand theRightPeriodtype create the following name‛.(e2 80 9b ef bc 8e)ivandeex commentedon Mar 16, 2021
No, it's not a "normal" ASCII dot but a UTF-8 pseudographics glyph that looks like a dot but is treated like a filename character by cloud. rclone performs this and other translations provider-wise.
Normally it should be adjustable via command line by
--BACKEND-encoding=comma,delimited,tokens(https://rclone.org/overview/#encoding and https://rclone.org/drive/#drive-encoding). I don't understand why it didn't work in your case. Gotta dig around this code https://github.com/rclone/rclone/blob/v1.53.4/backend/drive/drive.go#L491fabh2o commentedon Mar 16, 2021
I have tried other options for the
--drive-encoding=flag, the results are in the PS of my previous commentivandeex commentedon Mar 16, 2021
Looks like a bug!
ivandeex commentedon Mar 16, 2021
This same trick worked for dropbox - #4875 (comment)
I will investigate why it sucks for drive.
ivandeex commentedon Mar 16, 2021
@ncw
Let's introduce an option
--normalize-pathto normalize.and..in paths before encodingwith choices
always,local,off,warn,?with
localas default to turn it on by default for local storage only?
Moreover, it can be put in a future profile #2697
EDIT
If you agree in general to have path normalization in addition to (before / on top) path encoding, let's open another github issue or a forum thread to discuss details. I'm asking here only to stay close to a typical use, for convenience.
Consider #4897 (comment) and #4875 (comment)
Agreed with your #4948 (comment)
ncw commentedon Mar 23, 2021
A flag is a good idea.
I wonder whether it might be backend configurable also.
I think all the backends except for the bucket based backends (s3, gcs, swift, b2, etc) would always want normalized paths. These backends have a strong concept of a filesystem with folders for which path normalization makes sense.
So maybe the selection should be
always,auto,off,warnwhereautolooks to see iff.Features().BucketBasedis set and doesn't normalize paths for those.What do you think?
OK