On Mon, 6 Feb 2012, karste...@dcon.de wrote:
> While the Unicode version almost exclusively uses wide-char APIs, it
> also limits all filename conversions to MAX_PATH (260) characters, so
> no, my work doesn't address the long filename issue.
IIRC modern (i.e. post-W2K) Windows versions had a longer path limit, no?
We already dropped support for Windows 98 (much to my chagrin, but it
became too difficult), so maybe it's time to drop W2K support (unless, of
course, an interested person comes along and puts in some real effort)?
Ciao,
Dscho
On Mon, 6 Feb 2012, karste...@dcon.de wrote:
> Johannes Schindelin <Johannes....@gmx.de> wrote on 06.02.2012
> 06:08:29:
>
Thanks for the explanation, I uunderstand now!
Dscho
The latest unicode patches are here:
https://github.com/kblees/git/tree/kb/unicode-v15
However, as I said before, the PATH_MAX limit is all throughout git core (...and the entire MinGW/MSYS-based tool chain).
You might try cygwin-git instead, PATH_MAX in cygwin seems to be 4096. I don't know if it will automatically prefix long paths with \\?\ though.
I think the effort to support extended paths and utf8 path names throughout the msys software stack is a worthwhile goal. The modern development landscape is international and cross-platform. It would be nice if the system just worked to give you a consistent experience across both *nix and Windows. Having 4096 utf8 bytes to work with on *nix and 260 on Windows is a big difference. Its a difference that can cause one headaches when he's trying to make complex tools work across both platforms. The symlink support that Michael was working on is also very desirable.
I've looked at the code for msys. I see no reason why using macros for functions like open & fopen to bypass those in the vc runtime woudn't work. At this point, there work is halfway done as mysys is now patched to override other Windows functions. ONce you provide the macro overrides in the mysys stdio.h, you should be able to just recompile bash, perl, etc and it would all just work. I don't see why relative paths would be a problem in terms of prepending "\\?\" because if you are calling something like open() with a relative path, its going to be relative to the current working directory. One can always query the current working directory and calculate the absolute path inside the wrapper function.
I was my goal to try such a scheme. However, I've lost so much time just fighting with the dev environment and the irritations of Windows, that I have to table my efforts. There is just too much of a learning curve for me since I'm not that familiar with Windows development. I have to move on for now. I might tinker with it in the future. If someone else wants to work on it, I might be able to contribute some dev time in support of that effort, but unfortunately, i'm not in a position where I can take the lead. If someone wants to take the lead on the effort and would like a helper, let me know.
all of that said, I think the better solution would be to stop linking apps against MS' standard lib and create an msys version of libc. This library would dynamically load the vc runtime and call the functions by means of dynamically acquired function pointers. That way, you don't have to play macro-meta-programming games (which are problematic) and you would have full freedom to extend MS' runtime in a more posix friendly way.
BTW: I did look at cygwin. I couldn't find in their source code where they patch open and fopen. I couldn't find it. But, even if they do support the extended file names, they don't translate unix symlinks to Windows symlinks. They probably would if the morons at Microsoft hadn't made mklink a privileged operation. But, that's the way it is. And those of us looking to integrate Windows into *nix development efforts just have to hack things and go through extra maintenance hassles.
BTW. Does any one know what role "newlib" plays in msys and cywin? I couldn't exactly discern that.