xiph / flac

Free Lossless Audio Codec
https://xiph.org/flac/
GNU Free Documentation License v1.3
1.58k stars 278 forks source link

255 byte path limit on Windows is a thing of the past since 2016, please respect that for flac/metaflac #689

Open crankedguy opened 3 months ago

crankedguy commented 3 months ago

Hi,

would it be possible that flac and metaflac can respect that the 255byte limit on Windows 10+ is a thing of the past as said since 2016. It is more than annoying that in my batch processes both command line programs tell me that no files with the given name exist

 ERROR: reading metadata, status = "FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE"

The FLAC file could not be opened.  Most likely the file does not exist
or is not readable.

The files are perfectly OK and usable, can be tested with any other program (e.g. ffprobe) or loaded (foobar etc,), I have to program workarounds to make testing/executing flac/metaflac possible. It is no offense of course, but I think after 10 years this should be doable.

Please write me a short reply if you intend to fix that, or not.

Many thanks!

ktmf01 commented 2 months ago

I would fix it, but I have no idea where the problem is. I have little knowledge of legacy Windows relic specifics. The problem is probably convoluted with Windows-specific UTF-8 code.

crankedguy commented 2 months ago

@ktmf01 Would this be of any help to you, especially regarding the mention of the affected/mentioned file management functions?

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

crankedguy commented 2 months ago

I also saw that this was literally already documented here https://github.com/xiph/flac/issues/687 so sorry for the somewhat dupe as it comes down to the same problem

ktmf01 commented 2 months ago

the 255byte limit on Windows 10+ is a thing of the past as said since 2016

I just tried setting the LongPathsEnabled registry key on my Windows 10 22H2 system, and found out both Windows File Explorer as well as the regular command line are unable to deal with such paths. For example, when running any command (for example, netstat) on the command line I get the error 'The current directory is invalid.'

So, it seems this path limit isn't a thing of the past even today. If such basic Windows tools are unable to deal with long paths, I cannot properly troubleshoot a fix, so I cannot fix this.

crankedguy commented 2 months ago

What should I say to that. I don't write such a post to troll around but I take your word for it that it happened like that.

I enabled this through Group Policy and neither any file explorer (Windows explorer, Directory Opus), nor command line, nor programs that respect that modernization like e.g., foobar have any problems with even 300+ bytes file paths at all.

Of course I respect that it won't be fixed though!

crankedguy commented 2 months ago

On the other hand there is a lot of software out there that still does not handle it correctly, yes, I am fully with you on that.

vlakoff commented 2 weeks ago

Indeed, this file path limit still isn't a thing from the past, sadly…

However, the more pieces of software able to circumvent the limit, the better. That's how the limit will become a thing from the past, hopefully.

(though, Microsoft should at least fix their File Explorer… *cough cough*)