mirror of
https://github.com/denoland/deno.git
synced 2025-01-12 00:54:02 -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) {
|
switch (true) {
|
||||||
case info.isFile:
|
case info.isFile:
|
||||||
view.setUint8(buf_out, FILETYPE_REGULAR_FILE);
|
view.setUint8(buf_out, FILETYPE_REGULAR_FILE);
|
||||||
buf_out += 4;
|
buf_out += 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case info.isDirectory:
|
case info.isDirectory:
|
||||||
view.setUint8(buf_out, FILETYPE_DIRECTORY);
|
view.setUint8(buf_out, FILETYPE_DIRECTORY);
|
||||||
buf_out += 4;
|
buf_out += 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case info.isSymlink:
|
case info.isSymlink:
|
||||||
view.setUint8(buf_out, FILETYPE_SYMBOLIC_LINK);
|
view.setUint8(buf_out, FILETYPE_SYMBOLIC_LINK);
|
||||||
buf_out += 4;
|
buf_out += 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
view.setUint8(buf_out, FILETYPE_UNKNOWN);
|
view.setUint8(buf_out, FILETYPE_UNKNOWN);
|
||||||
buf_out += 4;
|
buf_out += 8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
view.setUint32(buf_out, Number(info.nlink), true);
|
view.setUint32(buf_out, Number(info.nlink), true);
|
||||||
buf_out += 4;
|
buf_out += 8;
|
||||||
|
|
||||||
view.setBigUint64(buf_out, BigInt(info.size), true);
|
view.setBigUint64(buf_out, BigInt(info.size), true);
|
||||||
buf_out += 8;
|
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() {
|
fn main() {
|
||||||
let metadata = std::fs::metadata("/fixture/directory").unwrap();
|
let metadata = std::fs::metadata("/fixture/directory").unwrap();
|
||||||
assert!(metadata.is_dir());
|
assert!(metadata.is_dir());
|
||||||
assert!(metadata.len() > 0);
|
|
||||||
|
|
||||||
let metadata = std::fs::metadata("/fixture/symlink_to_directory").unwrap();
|
let metadata = std::fs::metadata("/fixture/symlink_to_directory").unwrap();
|
||||||
assert!(metadata.is_dir());
|
assert!(metadata.is_dir());
|
||||||
assert!(metadata.len() > 0);
|
|
||||||
|
|
||||||
let metadata = std::fs::metadata("/fixture/file").unwrap();
|
let metadata = std::fs::metadata("/fixture/file").unwrap();
|
||||||
assert!(metadata.is_file());
|
assert!(metadata.is_file());
|
||||||
assert!(metadata.len() > 0);
|
assert_eq!(metadata.len(), 5);
|
||||||
|
|
||||||
let metadata = std::fs::metadata("/fixture/symlink_to_file").unwrap();
|
let metadata = std::fs::metadata("/fixture/symlink_to_file").unwrap();
|
||||||
assert!(metadata.is_file());
|
assert!(metadata.is_file());
|
||||||
assert!(metadata.len() > 0);
|
assert_eq!(metadata.len(), 5);
|
||||||
|
|
||||||
let metadata = std::fs::metadata("/fixture/directory/file").unwrap();
|
let metadata = std::fs::metadata("/fixture/directory/file").unwrap();
|
||||||
assert!(metadata.is_file());
|
assert!(metadata.is_file());
|
||||||
assert!(metadata.len() > 0);
|
assert_eq!(metadata.len(), 15);
|
||||||
|
|
||||||
let metadata =
|
let metadata =
|
||||||
std::fs::metadata("/fixture/directory/symlink_to_file").unwrap();
|
std::fs::metadata("/fixture/directory/symlink_to_file").unwrap();
|
||||||
assert!(metadata.is_file());
|
assert!(metadata.is_file());
|
||||||
assert!(metadata.len() > 0);
|
assert_eq!(metadata.len(), 15);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue