Skip to content
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

Merged
merged 5 commits into from
Aug 14, 2019
Merged

Add more file IO operations #1540

merged 5 commits into from
Aug 14, 2019

Conversation

LukaJCB
Copy link
Member

@LukaJCB LukaJCB commented Jul 16, 2019

Just a WIP for #1533

@mpilquist
Copy link
Member

@LukaJCB Any progress on this on? I'd love to get it in 1.1.0 release that's coming up soon.

@LukaJCB
Copy link
Member Author

LukaJCB commented Aug 7, 2019

I'll have time to work on this tonight :)

@LukaJCB LukaJCB changed the title WIP: add more file IO operations Add more file IO operations Aug 12, 2019
@LukaJCB
Copy link
Member Author

LukaJCB commented Aug 12, 2019

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: _*))
Copy link
Member

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?

Copy link
Member Author

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 :)

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good point 👍

Copy link
Member

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.

@mpilquist mpilquist merged commit 265214e into typelevel:series/1.1 Aug 14, 2019
@LukaJCB LukaJCB deleted the files branch August 14, 2019 15:27
@mpilquist mpilquist modified the milestones: 1.1.0-M2, 1.1.0 Sep 6, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants