Rustaceans...Seems a function to say whether you can read or file or write a file would some good functions. Even with unix:fs:PermissionsExt I need to do a little bit of bit math to just figure out if I can read a file or not. #amIlazy
-
-
Replying to @tom_enebo
https://doc.rust-lang.org/nightly/std/fs/struct.Metadata.html#method.permissions …, checking if a file is readonly is the only thing you can do across platforms
1 reply 0 retweets 0 likes -
-
-
Replying to @sgrif
I want to know read not readonly. Or am I getting hung up on that fn name?
1 reply 0 retweets 0 likes -
Replying to @tom_enebo @sgrif
To be sure this is in a
#cfg unix and with mode() I can make the test with simple bit math but I was hoping *Ext would also add more than mode().1 reply 0 retweets 0 likes -
Replying to @tom_enebo
Correct me if I'm wrong, but if you can get the mode of a file, you have permission to read it don't you?
1 reply 0 retweets 0 likes -
Replying to @sgrif @tom_enebo
Anyway yeah, `mode` is what you're looking for
1 reply 0 retweets 0 likes -
Replying to @sgrif
yeah I was just hoping for convenience of isReadable() or something vs mode & (libc:: S_IRUSR | ... ) or whatnot. Mild problem I know :)
2 replies 0 retweets 0 likes
It definitely seems reasonable. I'll bet if you opened a PR it'd be accepted
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.