Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POSIX permission operations #76

Merged
merged 5 commits into from
Sep 14, 2017
Merged

POSIX permission operations #76

merged 5 commits into from
Sep 14, 2017

Conversation

eed3si9n
Copy link
Member

@eed3si9n eed3si9n commented Sep 13, 2017

This adds wrapper methods and functions around NIO's POSIX operations.
The implementation is heavily based on @pathikrit's better-files library, but I've made some minor changes.

  • sbt IO supports 2.10 - 2.13.
  • I've added Scaladoc with warnings that some operations require POSIX filesystem.
  • better-files uses implicits everywhere to pass around the preference on whether the symbolic links should be followed etc, but seems to be planned to remove all implicits in 4.0.0. sbt IO also removes the implicits by creating two datatypes RichFile and LinkOptionPath.
  • My implementation is in an universal trait, partly because sbt.io.RichFile is a value class. This means File to NIO Path is happening on all operations. To cache Path like better-files's File, use LinkOptionPath.
  • Fixes the name isOtherReadable to isOthersReadable, following the NIO flag name.
  • Adds test for underlying filesystem such as IO.isPosix and IO.hasAclFileAttributeView.
  • In addition to IO.chmod(..), IO.chown(..) adds English name IO.setPermissions(..), IO.setOwner(..) following the sbt IO convention.

caveat

These will become new methods added to our API, so if a plugin starts using them it will bump up the minimum required sbt version to whichever that shipped this change. Thus, we should ship in a feature release 1.1.

@typesafe-tools
Copy link

The validator has checked the following projects against Scala 2.12,
tested using dbuild, projects built on top of each other.

Project Reference Commit
sbt 1.x sbt/sbt@34945af
zinc 1.x sbt/zinc@ef3a2c4
io pull/76/head 71bd6ca
librarymanagement 1.x sbt/librarymanagement@0419371
util 1.x sbt/util@cba6f83
website 1.x

❌ The result is: FAILED
(restart)

@dwijnand dwijnand merged commit 62004b2 into sbt:1.x Sep 14, 2017
@eed3si9n eed3si9n deleted the wip/permission branch September 14, 2017 13:40
@muuki88
Copy link
Contributor

muuki88 commented Dec 1, 2017

Nice 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants