mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 15:49:44 -05:00
fix(std/wasi): path_filestat_get padding (#6509)
This commit is contained in:
parent
6c093c0b5a
commit
40dcfc8996
2 changed files with 9 additions and 11 deletions
|
@ -864,27 +864,27 @@ export default class Module {
|
|||
switch (true) {
|
||||
case info.isFile:
|
||||
view.setUint8(buf_out, FILETYPE_REGULAR_FILE);
|
||||
buf_out += 4;
|
||||
buf_out += 8;
|
||||
break;
|
||||
|
||||
case info.isDirectory:
|
||||
view.setUint8(buf_out, FILETYPE_DIRECTORY);
|
||||
buf_out += 4;
|
||||
buf_out += 8;
|
||||
break;
|
||||
|
||||
case info.isSymlink:
|
||||
view.setUint8(buf_out, FILETYPE_SYMBOLIC_LINK);
|
||||
buf_out += 4;
|
||||
buf_out += 8;
|
||||
break;
|
||||
|
||||
default:
|
||||
view.setUint8(buf_out, FILETYPE_UNKNOWN);
|
||||
buf_out += 4;
|
||||
buf_out += 8;
|
||||
break;
|
||||
}
|
||||
|
||||
view.setUint32(buf_out, Number(info.nlink), true);
|
||||
buf_out += 4;
|
||||
buf_out += 8;
|
||||
|
||||
view.setBigUint64(buf_out, BigInt(info.size), true);
|
||||
buf_out += 8;
|
||||
|
|
10
std/wasi/testdata/std_fs_metadata.rs
vendored
10
std/wasi/testdata/std_fs_metadata.rs
vendored
|
@ -3,26 +3,24 @@
|
|||
fn main() {
|
||||
let metadata = std::fs::metadata("/fixture/directory").unwrap();
|
||||
assert!(metadata.is_dir());
|
||||
assert!(metadata.len() > 0);
|
||||
|
||||
let metadata = std::fs::metadata("/fixture/symlink_to_directory").unwrap();
|
||||
assert!(metadata.is_dir());
|
||||
assert!(metadata.len() > 0);
|
||||
|
||||
let metadata = std::fs::metadata("/fixture/file").unwrap();
|
||||
assert!(metadata.is_file());
|
||||
assert!(metadata.len() > 0);
|
||||
assert_eq!(metadata.len(), 5);
|
||||
|
||||
let metadata = std::fs::metadata("/fixture/symlink_to_file").unwrap();
|
||||
assert!(metadata.is_file());
|
||||
assert!(metadata.len() > 0);
|
||||
assert_eq!(metadata.len(), 5);
|
||||
|
||||
let metadata = std::fs::metadata("/fixture/directory/file").unwrap();
|
||||
assert!(metadata.is_file());
|
||||
assert!(metadata.len() > 0);
|
||||
assert_eq!(metadata.len(), 15);
|
||||
|
||||
let metadata =
|
||||
std::fs::metadata("/fixture/directory/symlink_to_file").unwrap();
|
||||
assert!(metadata.is_file());
|
||||
assert!(metadata.len() > 0);
|
||||
assert_eq!(metadata.len(), 15);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue