Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   Use access() instead of stat() when possible (http://www.linux-archive.org/archlinux-pacman-development/107550-use-access-instead-stat-when-possible.html)

Xavier 06-16-2008 05:59 AM

Use access() instead of stat() when possible
 
Dan McGee wrote:
> We were using the stat() system call in quite a few places when we didn't
> actually need anything the stat struct returned- we were simply checking for
> file existence. access() will be more efficient in those cases.
>

I didn't know access, it is very nice. We can check the permissions in
the same time, we don't have an unused stat struct, and the name clearly
indicates what we do. Cool :)

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev


All times are GMT. The time now is 11:57 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.