Closed lpil closed 7 months ago
Yeah, it looks like they're inconsistently implemented as well 😂. Think I should deprecate them and add new ones or just go ahead to v2?
Ugh. Erlang is perfectly happy to give me information about "/etc" even when I shouldn't have permission, node not so much. But I guess that's okay as long as there's no false positives? Frustrating though.
AHA never mind all that it wasn't permissions it was me using lstatSync instead of statSync haha.
Deprecating and giving folks time to upgrade could be good, but what would they be called?
I've got everything implemented and cleaned up :) Took me forever to figure out fs.existsSync
also silently returns false haha.
Right now I'm calling them is_valid_file
and is_valid_directory
. But maybe something like verify_is_file
would be better? That way it's clear the error isn't with the file or dir, but with the verification (because the common error here would be permissions)
Had to run but didn't want to leave you hanging without these changes so I went with verify_is_file
and verify_is_directory
:)
Hello!
They return
Bool
rather thanResult(Bool, Error)
, so any errors get silently discarded and an incorrect result is returned.https://hexdocs.pm/simplifile/simplifile.html#is_file
https://hexdocs.pm/simplifile/simplifile.html#is_directory
Thanks, Louis