Server IP : 85.214.239.14 / Your IP : 18.191.68.112 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/root/usr/share/perl5/ |
Upload File : |
# Usage: # require "finddepth.pl"; # # &finddepth('/foo','/bar'); # # sub wanted { ... } # where wanted does whatever you want. $dir contains the # current directory name, and $_ the current filename within # that directory. $name contains "$dir/$_". You are cd'ed # to $dir when the function is called. The function may # set $prune to prune the tree. # # This library is primarily for find2perl, which, when fed # # find2perl / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune # # spits out something like this # # sub wanted { # /^\.nfs.*$/ && # (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && # int(-M _) > 7 && # unlink($_) # || # ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) && # $dev < 0 && # ($prune = 1); # } use File::Find (); *name = *File::Find::name; *prune = *File::Find::prune; *dir = *File::Find::dir; *topdir = *File::Find::topdir; *topdev = *File::Find::topdev; *topino = *File::Find::topino; *topmode = *File::Find::topmode; *topnlink = *File::Find::topnlink; sub finddepth { &File::Find::finddepth(\&wanted, @_); } 1;