-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add more file IO operations #1540
Conversation
@LukaJCB Any progress on this on? I'd love to get it in 1.1.0 release that's coming up soon. |
I'll have time to work on this tonight :) |
This should be good to review now, it doesn't comprise the full feature set, but it's a good start I think |
* method in security sensitive applications. | ||
*/ | ||
def exists[F[_]: Sync](path: Path, flags: Seq[LinkOption] = Seq.empty): F[Boolean] = | ||
Sync[F].delay(Files.exists(path, flags: _*)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this use Blocker
since it's doing FS access?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure in cases like these, since in general this should be super quick in most cases, but sure, I'll add it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I've felt the same way. Flip side is that pretty much everything in Files
API grabs a global mutex when looking up a file system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good point 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's important to use Blocker
, even here. Think about checking existence on an NFS mount, or even something more benign like a FUSE mount.
Just a WIP for #1533