Can you explain why you call stat() prior to unlink? # …

Friday, 19th April 2024

Comment on How to delete million of files on busy Linux servers (Work out Argument list too long) by Kent Fredric.

Can you explain why you call stat() prior to unlink?

# perl -e ‘for(){((stat)[9]<(unlink))}'

This "tip" is being parroted around the internet by people who don't understand what its for, and my reasonably thorough testing indicates the stat() call slows it down.

http://www.quora.com/Linux-why-stat+unlink-can-be-faster-than-a-single-unlink/answer/Kent-Fredric?__snids__=658761123&__nsrc__=2#

Share this on:

Comments are closed.