Skip to content

Commit b151cff

Browse files
committed
Revert "Fix listFiles() and listDirectory() to follow symbolic links (#6808)"
This reverts commit c8ff0ce.
1 parent 06cd260 commit b151cff

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

modules/nf-commons/src/main/nextflow/extension/FilesEx.groovy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import java.nio.ByteBuffer
2222
import java.nio.channels.SeekableByteChannel
2323
import java.nio.file.FileAlreadyExistsException
2424
import java.nio.file.FileSystemException
25-
import java.nio.file.FileVisitOption
2625
import java.nio.file.FileVisitResult
2726
import java.nio.file.Files
2827
import java.nio.file.LinkOption
@@ -659,9 +658,8 @@ class FilesEx {
659658
return null
660659

661660
final result = []
662-
final opts = EnumSet.of(FileVisitOption.FOLLOW_LINKS)
663661

664-
Files.walkFileTree(self, opts, Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
662+
Files.walkFileTree(self, new SimpleFileVisitor<Path>() {
665663

666664
FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
667665
if( filter == null || invokeFilter(filter, file, attrs) )

modules/nf-commons/src/test/nextflow/extension/FilesExTest.groovy

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -603,28 +603,6 @@ class FilesExTest extends Specification {
603603
sourceFolder.deleteDir()
604604
}
605605

606-
def 'should list files in symlinked directory' () {
607-
608-
given:
609-
def folder = Files.createTempDirectory('test')
610-
def realDir = folder.resolve('realDir')
611-
Files.createDirectories(realDir)
612-
realDir.resolve('file1.txt').text = 'Hello1'
613-
realDir.resolve('file2.txt').text = 'Hello2'
614-
def linkDir = folder.resolve('linkDir')
615-
Files.createSymbolicLink(linkDir, realDir)
616-
617-
when:
618-
def paths = linkDir.listFiles()
619-
620-
then:
621-
paths.size() == 2
622-
paths.collect { it.name }.sort() == ['file1.txt', 'file2.txt']
623-
624-
cleanup:
625-
folder?.deleteDir()
626-
}
627-
628606

629607
def testSetReadonly() {
630608

0 commit comments

Comments
 (0)