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

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

No Responses to “Can you explain why you call stat() prior to unlink? # …”

  1. Mr WordPress says:
    Unknown Unknown Unknown Unknown

    Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.

    View CommentView Comment