lune
lune copied to clipboard
Add support for fs.stat and fs.appendFile
Summary
At the moment @lune/fs has no support for fs.stat() and fs.appendFile(..).
Is there any chance to add it maybe in the upcoming update? Thanks!
would be nice if it returns "a symbolic link" correctly
would be nice if it returns "a symbolic link" correctly
This is already something which fs.metadata should support, although I think this is a bug due to which it doesn't behave as expected.
Not sure what fs.stat would do different from fs.isFile/fs.isDir and fs.metadata combined, other than being more convenient.
fs.metadata doesn't return "is a symbolic link" last time i checked, and there hasn't been any notes on releases that indicates a fix
i figured it might be easier to implement this and make it work correctly rather than fix fs.metadata, 🤷🏻♂️
The metadata method is supposed to support the following types: https://github.com/lune-org/lune/blob/b585234b081e60ca2e2fc2356f37b55140b937b3/crates/lune-std-fs/src/metadata.rs#L13-L19
As stated before, there's a bug which doesn't correctly identify symlinks. It makes more sense to fix incorrect behavior instead introducing a new feature to overshadow it.