aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath/path_test.go
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2022-11-08 16:10:47 -0800
committerDamien Neil <dneil@google.com>2022-11-09 22:06:14 +0000
commit61c57575cd01940d06a327ce61b8923bf4a7553a (patch)
treeb13d8850009e863fdd26564a9f1d5a59ed4c501d /src/path/filepath/path_test.go
parentbe9d78c9c5905fbc10d8cd6a4714dd4ad1c91674 (diff)
downloadgo-61c57575cd01940d06a327ce61b8923bf4a7553a.tar.xz
os: remove special casing of NUL in Windows file operations
Some file operations, notably Stat and Mkdir, special cased their behavior when operating on a file named "NUL" (case-insensitive). This check failed to account for the many other names of the NUL device, as well as other non-NUL device files: "./nul", "//./nul", "nul.txt" (on some Windows versions), "con", etc. Remove the special case. os.Mkdir("NUL") now returns no error. This is consonant with the operating system's behavior: CreateDirectory("NUL") succeeds, as does "MKDIR NUL" on the command line. os.Stat("NUL") now follows the existing path for FILE_TYPE_CHAR devices, returning a FileInfo which correctly reports the file as being a character device. os.Stat and os.File.Stat have common elements of their logic unified. For #24482. For #24556. For #56217. Change-Id: I7e70f45901127c9961166dd6dbfe0c4a10b4ab64 Reviewed-on: https://go-review.googlesource.com/c/go/+/448897 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Diffstat (limited to 'src/path/filepath/path_test.go')
0 files changed, 0 insertions, 0 deletions