-
Notifications
You must be signed in to change notification settings - Fork 8
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
Filediscovery: Path not found
when space in path, and path ends with \
(Windows 10)
#52
Comments
Windows is a bit weird when it comes to console arguments. Your case "X:\Anime\Kanon\" should not work either. It least it didn't when I tried it just now. |
Well that isn't annoying at all, seeing as Terminal adds the trailing
I'm not sure what you mean by this, as this is one of the examples I explicitly state does not work. Perhaps you meant to add an additional
So, assuming you're missing a trailing EDIT: I see now why the quotes are missing a |
Yes I also just now noticed that markdown didn't display it. I fixed that now. I can't easily "fix" that since I'm using the preparsed arguments which splits the arguments into an array of strings, already containing the error. I may switch to completely parsing the arguments myself on windows in the foreseeable future to avoid that issue. |
Not sure what you guys are doing, but if I tab-complete a path to a folder in the Windows 10 cmd.exe window it does not end with a Are you running it from a powershell console? That does end on |
@DvdKhl while I certainly won't tell you not to write your own complete parser for args, I don't think it should be necessary. I haven't looked at it too closely, but you should just be able to do a quick check or two on the items in the paths array before you create the FileStreamProvider with it. @kheldorn, as mentioned in the original post, I'm using Terminal, which I much prefer because it allows multiple tabs rather than opening another window (among various other features). I recognize the fact that Command Prompt does not append the trailing |
Ah, I think I see what you mean now about not being an easy fix, my previous suggestion would only work for a single path, but since adding two paths in the arguments is valid EDIT: According to this stackoverflow answer you can call an external method to get the actual raw string, though I'm not sure how that would work on other platforms. I'm assuming this is what you'd have to do in order to write your own argument parser. Alternatively there's this library that claims to work, though it looks like that might only be for .NET Framework, instead of Core. You might be able to adapt it for Core by replacing the |
Only difference is the trailing \ at the end of the path. Doesn't seem fixed to me? |
Environment
Writeup
So this is rather odd, and I'm not entirely sure if the title makes sense, so I've included my test cases at the bottom of the issue. Please note that I've tried both
'
and"
to see if there's any difference on the failing paths†. I've also included paths with no spaces in them, using various combinations of'
,"
, and trailing\
, to ensure that it is actually the space causing the error.I'd also like to note that when printing the
Filediscovery
error when a space is in the directory, it prints the trailing'
or"
, whereas when there is no space, it removes the character and just prints the path. I don't know if this is related, or useful at all, but I've included additions test paths for a true non-existent directory (X:\Anime\NotThere\
in case it wasn't obvious -- all other folders used exist on the file system) which shows what the 'normal' output for the error shows. You can also note that the error for the directory that actually doesn't exist properly prints the trailing\
, while it's missing from a directory with a space.† It seems like using Command Prompt, it won't accept
'
at all -- which could be a separate issue. I'm not sure if anything in cmd will accept paths surrounded by'
, or if it just accepts"
. I've tried both because I'm using Terminal, which accepts paths using either. Note the test using'
instead of"
returns a"
trailing the path in the error, which leads me to believe that Terminal is just converting the'
into a"
before the executable receives it, but I'm not sure about that.Sorry that this issue is kinda a massive info dump. I tried to include anything I might find useful as a developer, but if there's anything else you need/want to know or have me test, just let me know. I'll also try to take a look at the code later, to see if I can try to fix it myself.
Tests
Base Command (should it even matter):
.\AVDump3CL.exe --auth={snip} --Ed2kLogPath=ed2k.txt -R {path}
Paths tested:
'X:\Anime\Steins Gate\'
FAILS"X:\Anime\Steins Gate\"
FAILS'X:\Anime\Steins Gate'
WORKS"X:\Anime\Steins Gate"
WORKS'X:\Anime\Kanon\'
WORKS"X:\Anime\Kanon\"
WORKSX:\Anime\Kanon\
WORKS'X:\Anime\Kanon'
WORKS"X:\Anime\Kanon"
WORKSX:\Anime\Kanon
WORKSError Output:
'X:\Anime\Steins Gate\'
--Filediscovery: Path not found: X:\Anime\Steins Gate"
"X:\Anime\Steins Gate\"
--Filediscovery: Path not found: X:\Anime\Steins Gate"
'X:\Anime\NotThere\'
--Filediscovery: Path not found: X:\Anime\NotThere\
'X:\Anime\NotThere'
--Filediscovery: Path not found: X:\Anime\NotThere
X:\Anime\NotThere\
--Filediscovery: Path not found: X:\Anime\NotThere\
X:\Anime\NotThere
--Filediscovery: Path not found: X:\Anime\NotThere
The text was updated successfully, but these errors were encountered: