Skip Menu |

This queue is for tickets about the File-Find-Object-Rule CPAN distribution.

Report information
The Basics
Id: 124533
Status: rejected
Priority: 0/
Queue: File-Find-Object-Rule

People
Owner: Nobody in particular
Requestors: grzegorz.szyszlo [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Missed root items for option depth enabled as iterator mode
Date: Thu, 22 Feb 2018 10:24:54 +0100
To: bug-File-Find-Object-Rule [...] rt.cpan.org
From: Grzegorz Szyszlo <grzegorz.szyszlo [...] gmail.com>
Environment: Debian perl 5.20.2-3+deb8u9 Debian libfile-find-object-rule-perl 0.0305-1 perl -v This is perl 5, version 20, subversion 2 (v5.20.2) built for x86_64-linux-gnu-thread-multi (with 100 registered patches, see perl -V for more detail) additional info, linux distro debian/jessie , working directory is formatted as XFS. Example code that does not work as it should: use File::Find::Object::Rule; my   $rule=File::Find::Object::Rule->new(); $rule->mindepth(1);   #main directory should not be listed $rule->extras({'depth'=>1}); #additional option for descending scan, usable for remove tree $rule->start('/full/path/to/destroy/something'); #make iterator while (){     my $item = $rule->match(); #fetching iterator     last unless defined $item;  #this should be done here, because $item can be for example 0 or 00 or 000 file or directory, that is defined as false and breaks while loop.     print "$item\n";  #it in some situation does not display first level of subdirectories, because match() iterator does not give it.     #some optional work with destroying like:    #if (-d $item) {rmdir $item; next}; unlink $item;  #destroy file or directory   } prepare on first level about 16 subdirectories, at second level 256 subdirectories perl first level subdirectory, and in all 2th level subdirectory, prepare 256 empty files maked for example by touch shell command. Main directory contains only subdirectories, and its contains second level of subdirectories. Finally, second level subdirectories contains files. Variant one, match method gives all items, excepts first subdirectory level. Variant two, structure has only empty first subdirectory level, and all is working properly. I do some workaroud, continously call scanning with removing items, unless last scan gives no elements. Usually it do 2 scans.
On Thu Feb 22 04:25:31 2018, grzegorz.szyszlo@gmail.com wrote: Show quoted text
> Environment: > > Debian perl 5.20.2-3+deb8u9 > > Debian libfile-find-object-rule-perl 0.0305-1 >
Hi Gregor! It is not clear from your report how to reproduce the problem. Can you please read over https://github.com/shlomif/how-to-share-code-online carefully and prepare a github/etc. repo with everything that is needed to reproduce the problem? Perhaps use Test::More. Show quoted text
> perl -v > > This is perl 5, version 20, subversion 2 (v5.20.2) built for > x86_64-linux-gnu-thread-multi > (with 100 registered patches, see perl -V for more detail) > > additional info, linux distro debian/jessie , working directory is > formatted as XFS. > > > Example code that does not work as it should: > > use File::Find::Object::Rule; > > my   $rule=File::Find::Object::Rule->new(); > $rule->mindepth(1);   #main directory should not be listed > $rule->extras({'depth'=>1}); #additional option for descending scan, > usable for remove tree > $rule->start('/full/path/to/destroy/something'); #make iterator > > while (){ > >     my $item = $rule->match(); #fetching iterator > >     last unless defined $item;  #this should be done here, because > $item can be for example 0 or 00 or 000 file or directory, that is > defined as false and breaks while loop. > >     print "$item\n";  #it in some situation does not display first > level of subdirectories, because match() iterator does not give it. > >     #some optional work with destroying like: > >    #if (-d $item) {rmdir $item; next}; unlink $item;  #destroy file or > directory > >   } > > prepare on first level about 16 subdirectories, at second level 256 > subdirectories perl first level subdirectory, and in all 2th level > subdirectory, prepare 256 empty files maked for example by touch shell > command. > > > Main directory contains only subdirectories, and its contains second > level of subdirectories. Finally, second level subdirectories contains > files. > > Variant one, match method gives all items, excepts first subdirectory level. > > Variant two, structure has only empty first subdirectory level, and all > is working properly. > > > I do some workaroud, continously call scanning with removing items, > unless last scan gives no elements. Usually it do 2 scans.
On Thu Feb 22 06:06:30 2018, SHLOMIF wrote: Show quoted text
> On Thu Feb 22 04:25:31 2018, grzegorz.szyszlo@gmail.com wrote:
> > Environment: > > > > Debian perl 5.20.2-3+deb8u9 > > > > Debian libfile-find-object-rule-perl 0.0305-1 > >
> > Hi Gregor! > > It is not clear from your report how to reproduce the problem. Can you > please read over https://github.com/shlomif/how-to-share-code-online > carefully and prepare a github/etc. repo with everything that is > needed to reproduce the problem? Perhaps use Test::More. >
marking as rejected because my request was not handled for 4 months now. Show quoted text
> > perl -v > > > > This is perl 5, version 20, subversion 2 (v5.20.2) built for > > x86_64-linux-gnu-thread-multi > > (with 100 registered patches, see perl -V for more detail) > > > > additional info, linux distro debian/jessie , working directory is > > formatted as XFS. > > > > > > Example code that does not work as it should: > > > > use File::Find::Object::Rule; > > > > my   $rule=File::Find::Object::Rule->new(); > > $rule->mindepth(1);   #main directory should not be listed > > $rule->extras({'depth'=>1}); #additional option for descending scan, > > usable for remove tree > > $rule->start('/full/path/to/destroy/something'); #make iterator > > > > while (){ > > > >     my $item = $rule->match(); #fetching iterator > > > >     last unless defined $item;  #this should be done here, because > > $item can be for example 0 or 00 or 000 file or directory, that is > > defined as false and breaks while loop. > > > >     print "$item\n";  #it in some situation does not display first > > level of subdirectories, because match() iterator does not give it. > > > >     #some optional work with destroying like: > > > >    #if (-d $item) {rmdir $item; next}; unlink $item;  #destroy file > > or > > directory > > > >   } > > > > prepare on first level about 16 subdirectories, at second level 256 > > subdirectories perl first level subdirectory, and in all 2th level > > subdirectory, prepare 256 empty files maked for example by touch > > shell > > command. > > > > > > Main directory contains only subdirectories, and its contains second > > level of subdirectories. Finally, second level subdirectories > > contains > > files. > > > > Variant one, match method gives all items, excepts first subdirectory > > level. > > > > Variant two, structure has only empty first subdirectory level, and > > all > > is working properly. > > > > > > I do some workaroud, continously call scanning with removing items, > > unless last scan gives no elements. Usually it do 2 scans.