Is unlink any faster than rm?
|
|
Both are a wrapper to the same fundamental function which is an To weigh up the differences between the userland utilies.
You could demonstrate the difference with:
If however we're talking about an unadulterated call to the system You can perform a system Edit: Sorry, clarified the difference between |
|||||||||||||||
|
|
At the POSIX spec level, what rm does is specified much more tightly than what unlink does. The portability of the outcome seems likely to be better using rm, if your script has to run across OS's. |
||||
|
|
|
The slow part of removing is the filesystem code and disk stuff, not the userspace preparation of the unlink() system call. I.e.: if the speed difference matters, then you shouldn't be storing the data on the file system. unlink is just a rm "light". rm has more features but they do the same thing. |
|||
|
|