lune icon indicating copy to clipboard operation
lune copied to clipboard

Add support for fs.stat and fs.appendFile

Open 0xJWLabs opened this issue 1 year ago • 4 comments

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!

0xJWLabs avatar Jun 26 '24 16:06 0xJWLabs

would be nice if it returns "a symbolic link" correctly

RuizuKun-Dev avatar Jul 26 '24 09:07 RuizuKun-Dev

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.

CompeyDev avatar Jul 26 '24 11:07 CompeyDev

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, 🤷🏻‍♂️

RuizuKun-Dev avatar Jul 26 '24 22:07 RuizuKun-Dev

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.

CompeyDev avatar Jul 27 '24 05:07 CompeyDev