Skip to content

Commit

Permalink
add dont_use_nlink option to list_tree method in Mojo::File (closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 1, 2018
1 parent 53615cb commit 32118b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,5 +1,6 @@

7.62 2018-02-01
- Added dont_use_nlink option to list_tree method in Mojo::File.
- Fixed a promise resolution bug in Mojo::Promise.

7.61 2018-01-08
Expand Down
9 changes: 9 additions & 0 deletions lib/Mojo/File.pm
Expand Up @@ -54,6 +54,9 @@ sub list_tree {
# This may break in the future, but is worth it for performance
local $File::Find::skip_pattern = qr/^\./ unless $options->{hidden};

# The File::Find documentation lies, this is needed for CIFS
local $File::Find::dont_use_nlink = 1 if $options->{dont_use_nlink};

my %all;
my $wanted = {wanted => sub { $all{$File::Find::name}++ }, no_chdir => 1};
$wanted->{postprocess} = sub { delete $all{$File::Find::dir} }
Expand Down Expand Up @@ -320,6 +323,12 @@ These options are currently available:
Include directories.
=item dont_use_nlink
dont_use_nlink => 1
Force L<File::Find> to always stat directories.
=item hidden
hidden => 1
Expand Down

0 comments on commit 32118b0

Please sign in to comment.