deleting a million or so image files

frank

Distinguished
Dec 31, 2007
1,588
0
19,780
Archived from groups: microsoft.public.win2000.file_system (More info?)

Does anybody know a fast way to delete about a million or
more image files sitting in a single windows 2000
directory. I'll have to do this on a weekly basis.

Normal windows explorer deletion is VERY slow (lots of
minutes to some hours!) and I've also tried a DOS batch
file, but its still very slow.

Are there any tools or tips to make this process quicker ?
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.file_system (More info?)

Can you delete the directory and re-create or is this a selective delete
(i.e. all file older than 'x' days get killed off)?

Explorer and a .bat job basically do the same thing:
1) FindFirstFile
2) Delete it
3) Get the next file.


Pat

"Frank" <anonymous@discussions.microsoft.com> wrote in message
news:18b001c426d2$a7e90370$a301280a@phx.gbl...
> Does anybody know a fast way to delete about a million or
> more image files sitting in a single windows 2000
> directory. I'll have to do this on a weekly basis.
>
> Normal windows explorer deletion is VERY slow (lots of
> minutes to some hours!) and I've also tried a DOS batch
> file, but its still very slow.
>
> Are there any tools or tips to make this process quicker ?
 

frank

Distinguished
Dec 31, 2007
1,588
0
19,780
Archived from groups: microsoft.public.win2000.file_system (More info?)

Pat,

I could delete the directory and re-create it on a weekly
basis - (by the way I have this directory compressed to
save space).

Will this be any faster ??

From a batch file I could use RMDIR /S and then MKDIR and
COMPACT to recreate a compressed directory.

If I were to manually delete the directory using windows
explorer under win2K (i.e. highlight it and press <DEL>) -
does it still have to delete all the files first?

I'm not sure how the actual mechanics of directory
deletion actually works in win2K ?

Frank.


>-----Original Message-----
>Can you delete the directory and re-create or is this a
selective delete
>(i.e. all file older than 'x' days get killed off)?
>
>Explorer and a .bat job basically do the same thing:
>1) FindFirstFile
>2) Delete it
>3) Get the next file.
>
>
>Pat
>
>"Frank" <anonymous@discussions.microsoft.com> wrote in
message
>news:18b001c426d2$a7e90370$a301280a@phx.gbl...
>> Does anybody know a fast way to delete about a million
or
>> more image files sitting in a single windows 2000
>> directory. I'll have to do this on a weekly basis.
>>
>> Normal windows explorer deletion is VERY slow (lots of
>> minutes to some hours!) and I've also tried a DOS batch
>> file, but its still very slow.
>>
>> Are there any tools or tips to make this process
quicker ?
>
>
>.
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.file_system (More info?)

I thought that the rmdir /s would not iterate the files, but it does (my
mistake), but I think that it would still be faster than the explorer
mechanism (less overhead). The RemoveDirectory API only works on empty
directories, so that's out.

For the absolute fastest mechanism, you could create a volume that is
specific for the files and just do a quick format every week. That would
blow away the MFT, which would take only a few seconds. Then re-create the
folder/share (scripted) and you're good to go. This would also have the
side benefit of keeping volume fragmentation to a minimum.

One other thought that I have though is if the compression of the directory
is getting you very much relative to the induced overhead. If the images
are already in a compacted format (e.g. .jpg, mpeg, etc.) then the
compression won't be very much (a few percent) and you would definitely get
better throughput by turning it off. If, on the other hand the files are
..bmp/.tiff (or some other highly compressible format) it probably is worth
the additional overhead.


Pat


"Frank" <anonymous@discussions.microsoft.com> wrote in message
news:21a901c42785$b77b9600$a001280a@phx.gbl...
> Pat,
>
> I could delete the directory and re-create it on a weekly
> basis - (by the way I have this directory compressed to
> save space).
>
> Will this be any faster ??
>
> From a batch file I could use RMDIR /S and then MKDIR and
> COMPACT to recreate a compressed directory.
>
> If I were to manually delete the directory using windows
> explorer under win2K (i.e. highlight it and press <DEL>) -
> does it still have to delete all the files first?
>
> I'm not sure how the actual mechanics of directory
> deletion actually works in win2K ?
>
> Frank.
>
>
>>-----Original Message-----
>>Can you delete the directory and re-create or is this a
> selective delete
>>(i.e. all file older than 'x' days get killed off)?
>>
>>Explorer and a .bat job basically do the same thing:
>>1) FindFirstFile
>>2) Delete it
>>3) Get the next file.
>>
>>
>>Pat
>>
>>"Frank" <anonymous@discussions.microsoft.com> wrote in
> message
>>news:18b001c426d2$a7e90370$a301280a@phx.gbl...
>>> Does anybody know a fast way to delete about a million
> or
>>> more image files sitting in a single windows 2000
>>> directory. I'll have to do this on a weekly basis.
>>>
>>> Normal windows explorer deletion is VERY slow (lots of
>>> minutes to some hours!) and I've also tried a DOS batch
>>> file, but its still very slow.
>>>
>>> Are there any tools or tips to make this process
> quicker ?
>>
>>
>>.
>>