Which is more efficient...

Paul D. Anderson pda at stiatl.UUCP
Wed Feb 21 08:44:14 AEST 1990


pda at stiatl.UUCP (Paul D. Anderson) writes:
>Which is more efficient (ie: cheaper and faster) in a program?
> - to chdir("/path") and then unlink("file") for each file in the 

Let me clarify my question from the previous posting:
I know of namei() in the kernal, it has been suggested that doing
the chdir() first will mean namei() will not have to be invoked as
often.  But does not unlink() have to chase back up the directory
structures (re-construct the directory tree) in order to ascertain
if the correct permissions exist to allow removal of the file?  Therefore,
would not calling unlink() with the full pathname be more efficient,
since all information is provided to unlink() about the path?

>Please E-Mail to me and I will summarize and re-post.
thanks,
paul
-- 
--
Paul Anderson * h:404-565-0761 w:841-4000
{mathcs.emory,gatech}.edu!stiatl!pda  ||  pda at SalesTech.Com



More information about the Comp.unix.questions mailing list