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

ls.rec fails if a single file is inaccesible #679

Closed
DavidPerezIngeniero opened this Issue Aug 10, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@DavidPerezIngeniero

DavidPerezIngeniero commented Aug 10, 2017

When doing ls.rec over /home/david, I get this exception:

java.nio.file.AccessDeniedException: /home/david/.cache/dconf
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:427)
        at java.nio.file.Files.newDirectoryStream(Files.java:457)
        at ammonite.ops.ls$iter$.$anonfun$apply$6(FileOps.scala:210)
        at geny.Generator$SelfClosing.generate(Generator.scala:219)
        at geny.Generator$Filtered.generate(Generator.scala:269)
        at geny.Generator$FlatMapped.generate(Generator.scala:284)
        at geny.Generator$Concat.generate(Generator.scala:236)
        at geny.Generator$Mapped.generate(Generator.scala:276)
        at geny.Generator$FlatMapped.$anonfun$generate$5(Generator.scala:285)
        at geny.Generator$Filtered.$anonfun$generate$3(Generator.scala:269)
        at geny.Generator$SelfClosing.generate(Generator.scala:222)
        at geny.Generator$Filtered.generate(Generator.scala:269)
        at geny.Generator$FlatMapped.generate(Generator.scala:284)
        at geny.Generator$Concat.generate(Generator.scala:236)
        at geny.Generator$Mapped.generate(Generator.scala:276)
        at geny.Generator$FlatMapped.$anonfun$generate$5(Generator.scala:285)
        at geny.Generator$Filtered.$anonfun$generate$3(Generator.scala:269)
        at geny.Generator$SelfClosing.generate(Generator.scala:222)
        at geny.Generator$Filtered.generate(Generator.scala:269)
        at geny.Generator$FlatMapped.generate(Generator.scala:284)
        at geny.Generator$Mapped.generate(Generator.scala:276)
        at geny.Generator.foreach(Generator.scala:48)
        at geny.Generator.foreach$(Generator.scala:48)
        at geny.Generator$Mapped.foreach(Generator.scala:274)
        at geny.Generator.toBuffer(Generator.scala:120)
        at geny.Generator.toBuffer$(Generator.scala:118)
        at geny.Generator$Mapped.toBuffer(Generator.scala:274)
        at geny.Generator.toVector(Generator.scala:128)
        at geny.Generator.toVector$(Generator.scala:128)
        at geny.Generator$Mapped.toVector(Generator.scala:274)
        at ammonite.ops.ls$.materialize(FileOps.scala:205)
        at ammonite.ops.ls$Walker.materialize(FileOps.scala:237)
        at ammonite.ops.ls$Walker.materialize(FileOps.scala:233)
        at ammonite.ops.StreamableOp1.apply(FileOps.scala:68)
        at ammonite.ops.StreamableOp1.apply$(FileOps.scala:68)
        at ammonite.ops.ls$Walker.apply(FileOps.scala:233)
        at ammonite.ops.ls$Walker.apply(FileOps.scala:233)
        at ammonite.ops.ImplicitOp.$bang(FileOps.scala:194)
        at ammonite.ops.ImplicitOp.$bang$(FileOps.scala:194)
        at ammonite.ops.ls$Walker.$bang(FileOps.scala:233)

I expect to obtain a list of accessible files, or, at least an easy way of doing so.

@piotrkwiecinski

This comment has been minimized.

Contributor

piotrkwiecinski commented Aug 12, 2017

@DavidPerezIngeniero I have more or less working solution for it. It's kinda ugly for. I'll try to make it cleaner and will try to add tests and make PR after.

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

piotrkwiecinski added a commit to piotrkwiecinski/Ammonite that referenced this issue Aug 12, 2017

@lihaoyi lihaoyi closed this in #682 Aug 14, 2017

lihaoyi added a commit that referenced this issue Aug 14, 2017

ls.rec handle inaccessible files (#682)
* ls.rec handle inaccessible files #679

* ls.rec handle inaccessible files - unstable changelog #679

* handle inaccessible files in ls.rec - permissions test #679
@DavidPerezIngeniero

This comment has been minimized.

DavidPerezIngeniero commented Aug 14, 2017

Thanks piotrkwiecinski!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment