# no_chdirĭoes not chdir() to each directory as it recurses. If false, the dangling symbolic link will be silently ignored. Otherwise, if true and warnings are on, a warning of the form "symbolic_link_name is a dangling symbolic link\n" will be issued. If true and a code reference, will be called with the symbolic link name and the directory it lives in as arguments. Specifies what to do with symbolic links whose target doesn't exist. If a directory or a symbolic link are about to be processed a second time, File::Find dies.įollow_skip=0 causes File::Find to die if any file is about to be processed a second time.įollow_skip=2 causes File::Find to ignore any duplicate files and directories but to proceed normally otherwise. # follow_skipįollow_skip=1, which is the default, causes all files which are neither directories nor symbolic links to be ignored if they are about to be processed a second time. If processing a file more than once (by the user's wanted() function) is worse than just taking time, the option follow should be used. Since only symbolic links have to be hashed, this is much cheaper both in space and time. This is similar to follow except that it may report some files more than once. If the link is a dangling symbolic link, then fullname will be set to undef. There is a variable $File::Find::fullname which holds the absolute pathname of the file with all symbolic links resolved. Note that this guarantee no longer holds if follow or follow_fast are not set. This enables fast file checks involving _. It is guaranteed that an lstat has been called before the user's wanted() function is called. If either follow or follow_fast is in effect: See "follow_fast" and "follow_skip" below. This might be expensive both in space and time for a large directory tree. Since directory trees with symbolic links (followed) may contain files more than once and may even have cycles, a hash has to be built up with an entry for each file. # followĬauses symbolic links to be followed. When follow or follow_fast are in effect, postprocess is a no-op. This hook is handy for summarizing a directory, such as calculating its disk usage. The name of the current directory is in $File::Find::dir. It is called in void context with no arguments. It is invoked just before leaving the currently processed directory. When follow or follow_fast are in effect, preprocess is a no-op. The code can be used to sort the file/directory names alphabetically, numerically, or to filter out directory entries based on their name alone. It is called with a list of strings (actually file/directory names) and is expected to return a list of strings. Your preprocessing function is called after readdir(), but before the loop that calls the wanted() function. The name of the currently processed directory is in $File::Find::dir. This code reference is used to preprocess the current directory. #SYNOPSIS use File::Find įind( in the first argument of find().
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |