[libvirt] stat() vs. access()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

While discussing some code with Matthias, we stumbled across many occurances
of stat() calls within the libVirt code (virFileExists() for example) which
could be implemented in a cheaper way when using access() instead of stat(),
when the only purpose is to check for the existance of a file.

The one thing I'm concerned about, is the question if access() does the right
thing in all situations. As the manpages didn't tell anything about
directories it might be worth to clarify this in advance.

A simple practical test showed that
  access ("/path/to/dir", F_OK)
seems to work as expected.

Any comments on these (optimization) thoughs?

Ciao
Matthias and Max
-- 
Gib Dein Bestes. Dann übertriff Dich selbst!

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]