in reply to unlink Question

Well, I think you should clarify what you mean by "causing damage to a drive or kill a hard drive from frequent use". Do you mean physical(hardware) or logical errors?

By that I mean:

Physical damage to the disk hardware is not likely. (Technically speaking, any disk activity does tiny amount of damage to the disk-head and storage-plates in the harddisk. You will need to replace your harddisk after a few years anyway.)

Depending how you define a damage to the file-system (physical?/logical?), improper use of unlink on directories will definitely damage your file-system. But I classify that as a logical error, not a hardware error. One logical error is already capable of damaging the file system, you don't even need the word 'frequent' here.

Replies are listed 'Best First'.
Re: Re: unlink Question
by lisaw (Beadle) on Nov 11, 2003 at 17:04 UTC
    Let me expand on my original question with an example...

    Lets say that the 'unlink' command is used when the directory, or files, that 'unlink' will remove are not present on the drive due to being manually removed. So, basically, unlink isn't finding the files to remove. Can this damage the drive?

    The reason for my original question was that I am trying to figure out if the use of the 'unlink' command caused the file structure on one of our servers to be completely wiped out causing the loss of all data on that drive.

    thank you...lis
      ... Can this damage the drive?
      No, not really. unlink isn't some unpredictable magical fairy {grin}, however, user beware
      #!/usr/bin/perl -T unlink $ENV{HOME} __END__ Insecure dependency in unlink while running with -T switch at - line 2 +.
      It is possible that you're getting tainted data, and that combined with the forementioned documented behaviour ... i hightly doubt perl's unlink is the culprit.

      Be sure to read perlsec (and turn taint on), and rule perl out as a culprit.

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.