-
Notifications
You must be signed in to change notification settings - Fork 31
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
Implement long path pseudo current directory #106
Comments
That's what
As you noted, this has (bad) compatibility consequences. CMD will interpret these current directories as UNC, which means it automatically change directory to |
Unfortunately when testing For example I get after cd -e:
Maybe this is because I use Old windows Server 2003? Windows 7 also gets this problem (I just checked). I was not sure of what the -e parameter meant because indeed it made no difference when trying to chdir in a long path name. Sorry I forgot to mention that. Or maybe you mean something else? |
Ouch, you're right, it looks like As far as I can tell:
Currently the only way I could see this working is to temporarily reset current directory before launching a child, launch the child with debugging enabled, and patch the child's memory to contain the correct current directory and buffer lengths. The problem with doing this is it needs to be recursive - when the child wants to launch another child, that needs to be fixed up too, but In other words, I'm not sure it's worth pursuing :) Yori already has code to be a debugger in certain cases, but this seems like the most invasive case yet. |
I agree it would be too much trouble. Maybe the |
I wanted to first thanks you for your amazing work. on this project.
In the WIN32 API we are limited to MAX_PATH for the current directory.
Yori for now uses the
SetCurrentDirectory()
function in its implementation of the YoriLibSetCurrentDirectory() when calling chdir.So when I try to chdir to a very long path name I get the
The filename or extension is too long.
errorI was wondering if Yori could instead simulate a pseudo current directory (issuing a warning maybe), so that file manipulation would behave more transparently.
When you would call any internal command, Yori would expend the full path name with the
\\?\
prefix to the command. This way it would be more convenient to work on a set of files that are nested deeply. As long as the commands you use are long path aware.Of course all the Yori commands are already long path aware, so it would not require extra work for them.
There would still be a problem when calling an external command because there is no way Yori could know for sure if a parameter is supposed to be a filename. So people will have to Use Ctrl+Tab, but it would be fine in my opinion.
There is also the option to use the short path name if available when path is too long for
SetCurrentDirectory()
. So people would not have to type the short path manually.This would push up quite a lot the depth at which you can normally work.
Of course you are more qualified than me to determine what the best option would be. I guess using short path name could also lead to other drawbacks.
EDIT: I am using the latest Yori 1.80 release under Windows Server 2003.
The text was updated successfully, but these errors were encountered: