-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat(fs): Add isBlockDevice
to FileInfo
#16064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favour.
Although I should point out that we have too many fields in FileInfo. Deno does not have an API for exists
/ access
. Those cases will use Deno.stat
and won't be accessing these meta fields at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM: Can you rebase this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires a rebase.
4c61368
to
f6c7d17
Compare
std::os::unix::fs::FileTypeExt is defined in Rust.
isFile
,isDirectory
,isSymlink
are defined inDeno.FileInfo
, butisBlockDevice
,isCharacterDevice
,isFIFO
,isSocket
are not defined.These are defined in Node.js fs.Stats, and it is good to be defined in
Deno.FileInfo
to improve compatibility.In this PR,
isBlockDevice
is defined. If this PR is approved, I will addisCharacterDevice
,isFIFO
,isSocket
as well in next PR.