Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Filenames containing "/" go missing #89

Open
hftf opened this issue Jun 18, 2015 · 10 comments
Open

Filenames containing "/" go missing #89

hftf opened this issue Jun 18, 2015 · 10 comments
Labels

Comments

@hftf
Copy link

hftf commented Jun 18, 2015

Create a Google Drive top-level folder named test. Inside, create a file named foo / bar (or foo/bar).

$ skicka ls test
skicka: test: file does not exist

Now rename the same file to foo, bar.

$ skicka ls test
foo, bar
@mmp
Copy link
Contributor

mmp commented Jun 30, 2015

Ugh. I hadn't realized that '/' was allowed in filenames. There are quite a few places in the code that assume that it can take a pull path and break it into components by splitting at '/' characters.

At minimum, it should probably warn about such files (and ignore them). The error message you're seeing is also not a good one.

Handling those for uploads and downloads would be fairly messy, as it's require a scheme to map those filenames to valid filenames on the host system (and back). (Which in turn needs to deal with "what if an existing file as the name you're trying to map it to", etc.)

@hftf
Copy link
Author

hftf commented Jun 30, 2015

This might belong in a separate issue, but I’m also experiencing other files (without / in the name) disappear. I can’t reproduce it from scratch, but renaming a currently “invisible” file doesn’t fix it. For example, I have two Google Docs in a shared folder, one and two, but notice:

$ skicka ls test
two
$ skicka ls test/one
skicka: test/one: file not found
$ skicka ls test/two
two

@agoode
Copy link
Contributor

agoode commented Jan 26, 2016

I'd like to figure out how to at least add a warning. I almost lost some files because of this silent behavior.

@mmp
Copy link
Contributor

mmp commented Jan 27, 2016

Almost losing files is very bad, so I'll definitely add a warning!

As a side note, I've confirmed that Drive will let me create a file 'foo/bar' as well as a directory 'foo' with a file 'bar' inside it.

One option would be to warn about (and then ignore) any files with '/'s in their path at startup time. This is a little sub-optimal, though--there's no reason one shouldn't see such files if one does a skicka ls in a folder that has some.

I think? that the only case that's dangerous for losing files is "download", in that said files won't be downloaded. Is that right? If so, I'll go ahead and only add the check there, any only for the set of files that are about to be downloaded, just so the warning isn't an annoyance in cases where it isn't applicable...

@hftf
Copy link
Author

hftf commented Jan 27, 2016

Potentially related bug and/or workaround: #95 (comment)

I wasn’t able to troubleshoot it completely, though. I might get a chance a few weeks from now.

@agoode
Copy link
Contributor

agoode commented Jan 27, 2016

Right, it's dangerous if you think you've got all your files but you don't.

I usually run skicka download a few times to make sure I've got everything (watching for errors), so I would want a message on download to warn me.

mmp pushed a commit that referenced this issue Feb 10, 2016
Drive allows file names to have slashes in them, and skicka doesn't handle
these files well. Previously, downloads would silently ignore these files,
which posed the risk of losing data; now at least we issue a warning about
each such file during downloads.

Issue #89.
@mmp
Copy link
Contributor

mmp commented Feb 10, 2016

Sorry for the delay in pushing this; the risk of file loss is a big deal, and I ended up going through a couple of more ambitious attempts to fix the root issue, all of which got bogged down in complexity.

So, for now at least there is a warning about any files with slashes during downloads.

@hftf
Copy link
Author

hftf commented Nov 30, 2017

I'd like for skicka download to at least have an option to rename files that contain a slash.

@agoode agoode added the bug label Apr 1, 2019
@hftf
Copy link
Author

hftf commented Mar 5, 2020

I just noticed that I’m still losing files with slashes when I use skicka download. Not only that, but when I use Google Drive to rename the files to remove the slashes, skicka ls shows erroneous filenames for several minutes (trimmed starting from where the last slash was in the original filename).

@max-mapper
Copy link

I know this issue is 6 years old but I would really love to see this fixed, as it's a blocker for me using it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants