Description
Change Intent
We want to consistently canonicalize all file names using Windows API so that all file, directory operations can consistently enjoy 32k-file name limit.
Caveat of using that API is that it treats nul
as regular file name and one has to use \\?\nul
to refer to this special file. In posix it's equivalent of '/dev/null'.
So here is the proposal to make this change in dart: File('NUL').writeAsBytesSync(bytes);
becomes File(r'\\?\NUL').writeAsBytesSync(bytes);
.
Justification
Windows support for long path names itself is breaking, so if Dart enables developers to use long paths then this breaking change is unavoidable.
Issues that are to be addressed by this change are #56125, #55972
See https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats for details on various windows file name formats.
Impact
This only concerns dart running on Windows. It is expected that use of 'nul' is rare if existent at all.
Existing code that reads from/writes to nul
will start throwing because nul
will be canonicalized to \\?\UNC\nul
- file location that can't be read to or written from.
Mitigation
Code that was reading from or writing to nul
will start throwing, have to be changed to refer to \\?\nul
.
Change Timeline
There change is already implemented, so it can be submitted as soon as it is approved.
Associated CLs
Metadata
Metadata
Assignees
Labels
Type
Projects
Status