calling `.stat()` on a `Descriptor` does not include correct file details
See original GitHub issuedetails:
wasm runtime: wasmer v0.4.2
assemblyscript version: v0.6
wasa version: master branch, commit f4162e73b6cbc3efd59f5cadd26b8b5b579b268f
// The entry file of your WebAssembly module.
import "allocator/arena"
import {
Console as console,
FileSystem as fs
} from '../wasa/assembly/wasa'
export function _start (): void {
let file = fs.open('./package.json')
let fileDetails = file.stat()
console.log(fileDetails.file_size.toString()) // always prints 0
console.log(fileDetails.file_type.toString()) // always prints 0
console.log(fileDetails.modification_time.toString()) // always prints 0.0
}
a few things come to mind…
- this could most certainly be user error…
- this could be an issue with the underlying runtime, so if that’s the case, please punt this issue 😃
- could it be an issue converting to strings for printing? (other tests i’ve done say probably not?)
or it could be something else! 😃
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
stat()--Get File Information - IBM
The stat() function gets status information about a specified file and places it in the area of memory pointed to by the buf...
Read more >c - stat() giving wrong information - Stack Overflow
The most viable reason for stat(2) failing is that you are not listing the current directory. The d_name member of the dirent structure...
Read more >stat(2) - Linux manual page - man7.org
fstat() is identical to stat(), except that the file about which information is to be retrieved is specified by the file descriptor fd....
Read more >stat(2) manual page
The stat() system call obtains information about the file pointed to by path. Read, write or execute permission of the named file is...
Read more >stat(2): file status - Linux man page - Die.net
These functions return information about a file. No permissions are required on the file itself, but-in the case of stat() and lstat() -...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ugh… did not not notice there was a newer version of
wasmer
available.v0.5.0
and this fixes things. should have started there. lesson learned.@jedisct1 apologies! just seeing this! the lucet command i wrote above was a typo, the command i actualy ran was the following with relative paths. not sure if this is what you had meant? anyways, my preference is to use wasmer at the moment, so i’m not to concerened. very much appreciated your patience on this :0