Using shell commands versus C equivalents

Alexander Leidinger Alexander at Leidinger.net
Wed Jun 13 06:58:34 UTC 2007


Quoting Garrett Cooper <youshi10 at u.washington.edu> (from Tue, 12 Jun  
2007 22:55:18 -0700):

> Another simple question (I hope):
>    Is there any reason why shell commands should be used in place of a
> C command (in this case chmod via vsystem instead of the chmod(2)
> function)? It seems like the fork / exec would be more expensive with
> the shell command, but any area where code could be optimized is more
> than welcome I would think.

If it is just one file, I don't see the reason to use the shell  
command, but if you need to reinvent "chmod -R", I don't see a reason  
to forbid the use of the shell command (pragmatic programming).

Bye,
Alexander.

-- 
Revenge is a form of nostalgia.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-hackers mailing list