diff options
author | Hirotaka Tagawa / wafuwafu13 <jaruwafu@gmail.com> | 2023-05-24 20:18:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-24 21:18:13 +0200 |
commit | 114ec3c1f71b40bd4bba473b0187e7c664ed1755 (patch) | |
tree | 7633e26d36133acf29b81de02418f7c7cfd2a847 /ext/fs/ops.rs | |
parent | 072e2b2fa236dd50040a210a425ff50ae39b0198 (diff) |
feat(ext/fs): add isBlockDevice, isCharDevice, isFifo, isSocket to FileInfo (#19008)
`isFile`, `isDirectory`, `isSymlink` are defined in `Deno.FileInfo`, but
`isBlockDevice`, `isCharacterDevice`, `isFIFO`, `isSocket` are not
defined.
---------
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ext/fs/ops.rs')
-rw-r--r-- | ext/fs/ops.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/fs/ops.rs b/ext/fs/ops.rs index 0fad92044..5bf3b1c6f 100644 --- a/ext/fs/ops.rs +++ b/ext/fs/ops.rs @@ -1596,6 +1596,10 @@ create_struct_writer! { rdev: u64, blksize: u64, blocks: u64, + is_block_device: bool, + is_char_device: bool, + is_fifo: bool, + is_socket: bool, } } @@ -1623,6 +1627,10 @@ impl From<FsStat> for SerializableStat { rdev: stat.rdev, blksize: stat.blksize, blocks: stat.blocks, + is_block_device: stat.is_block_device, + is_char_device: stat.is_char_device, + is_fifo: stat.is_fifo, + is_socket: stat.is_socket, } } } |