perl - Why did File::Find finish short of completely traversing a large directory? -


A directory contains a total of 2,153,425 items (according to the Windows folder properties). In it, .jpg and .gif image files are located within some subdirectories. To get some related information and to store it elsewhere, the images were to be transferred to different locations when querying the name of each file.

File: A script that uses search, which ended on 20462 files, with curiosity, I wrote a small recursive function to count those items, which have 1,734,802 numbers. I think the difference may be that the folders were not counted, only the files which passed the -f exams

The first questions asked for the file name can be solved differently instead of the problem. While running on the directory, I'm just thinking that the file: ending in a small fraction of all the files What could be the reason for this.

The data is stored on the NTFS file system.

The script of the script; I think the DBI stuff is not included, because I reconstruct the script with no one else, but a counter in process_img () that returns the same number.

  find (& amp; process_img, $ path_from); Sub process_image {eval {return if ($ _ eq "" or $ _ eq ".."); ## Quoting new routes for query and leaving create_spath ("$ path_to \\ img \\ $ dir_area \\ $ dir_address \\ $ type"); Copy ($ file :: search :: name, "$ path_to \\ img \\ $ dir_area \\ $ dir_address \\ $ type \\ $ new_name"); }; If ($ @) {print STDERR "eval bark: $ @ \ n"; Rediv}}  

Edit:

Evil has refused a few times about BII errors:

  DBD :: CSV: : DB failed: Before Miskayet single quote: Enter the value in 'IMG_Info (Path, Type, Floorplan, Legacy_ID)' (? 0? Building? 1? 0? 2? 1987 '' in C: / Pearl / Site / Insert value in 'IMG_info (Path, Type, Floorplan, Legacy_id) for Lib / SQL / Statement .75 Line 77 [Statement (' Wall / 15 Broad Street / Building / NYC-Wall-Saint-South-Saint-Seaport-Condo-Lift-Building-52201501.jpg ',' Building ',' 0 ',' 1987 ') "]  

I think that is due to the double dash between 'st' and 'south'.

  count_images ($ path_from); And no other errors of other nature were not reported.  

sub count_images {my $ path = shift; Display my $ images, $ path or die "path open path"; While (my $ item = readdir $ images) {next if $ item eq '.' Or $ item ek '..'; $ Img_counter ++ & amp; Amp; Next if -f "$ path / $ item"; Count_images ("$ path / $ item") if -d "$ path / $ item"; } Close $ images or die "$ path is closed"; } Print $ img_counter;

Can it be out of resources? (Memory, file descriptor, etc ...?).

Or it could have some exact file name (it is easy to test again by running again, but deleting 10 files - if this stops the exact file, the name of that file is criminal)

If you can locate the memory footprint, you can tell that you have a memory leak (see some recent questions on the memory leak to help with it).

And as Ether has said, we expect the candidates to be more than the usual investigative ideas pasted in the code.

UPDATE

Code:

  1. Please tell if there is anything bite for SETER < / P>

  2. More importantly, any IO operations require error-checking eg

    copy ($ some, $ other) || Dying "" $$ copied with some other $$ error: $! \ N "; # or print # directory to create similar

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -