You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But File.exists?("NUL") returns false. This somewhat contradictory result occurs for all special DOS device names, like COM1, AUX, and CONOUT$. File::Info.readable? and .writable? also have this issue.
The difference between the two is that the former calls CreateFileW whereas the latter calls GetFileAttributesW. Ruby works since File.exist? there returns true if and only if a platform-specific stat call succeeded; on Windows, this stat ultimately calls CreateFileW first.
This affects File.realpath too, as it internally calls Crystal::System::File.exists?. Ideally that should return \\.\NUL, a special path under the Win32 device namespace.
The text was updated successfully, but these errors were encountered:
On Windows, it is possible to query the null device
File::NULL = "NUL"
's info, or open it:But
File.exists?("NUL")
returns false. This somewhat contradictory result occurs for all special DOS device names, likeCOM1
,AUX
, andCONOUT$
.File::Info.readable?
and.writable?
also have this issue.The difference between the two is that the former calls
CreateFileW
whereas the latter callsGetFileAttributesW
. Ruby works sinceFile.exist?
there returns true if and only if a platform-specificstat
call succeeded; on Windows, thisstat
ultimately callsCreateFileW
first.This affects
File.realpath
too, as it internally callsCrystal::System::File.exists?
. Ideally that should return\\.\NUL
, a special path under the Win32 device namespace.The text was updated successfully, but these errors were encountered: