[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-dev] Re: new dirent module
From: |
Jim Hyslop |
Subject: |
[Cvs-dev] Re: new dirent module |
Date: |
Wed, 12 Jul 2006 10:45:35 -0400 |
User-agent: |
Mozilla Thunderbird 1.0.6 (Windows/20050716) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Derek R. Price wrote:
> Hey Jim,
>
> Do you know if there is any good reason why I shouldn't rip out most of
> the contrived directory cache in dirent.c and just save hFile in the DIR
> *, then only call _find_first() from opendir(), _find_next() from
> readdir(), and _find_close() from closedir()?
I'm not extremely familiar with the _find functions, but on a quick look
I don't see any problems. The MSDN implies that they are at least
reentrant, if not thread safe: "The _find functions allow nested calls."
> It seems to me that this would save a lot of overhead, so I'm not quite
> sure why it wasn't done this way in the first place. Are there race
> conditions involved if the directory changes while it is being read by
> the _find* functions?
No more than what would currently happen, as far as I can tell. I just
stepped through the test program provided by the MSDN, which basically
iterates through all *.c files in the current directory and prints out
basic information. After the call to _findnext, I deleted two of the
files, and the program kept going happily. _findfirst appears to take a
snapshot of the directory, just as opendir does.
- --
Jim Hyslop
Dreampossible: Better software. Simply. http://www.dreampossible.ca
Consulting * Mentoring * Training in
C/C++ * OOD * SW Development & Practices * Version Management
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFEtQsPLdDyDwyJw+MRAuMPAKCWe9+LX+ZztaNd6QYqs6zstAmWpgCg3yxi
R71QfqCu+DWPTvAjDWC1jbE=
=Tai9
-----END PGP SIGNATURE-----
- [Cvs-dev] Re: AC_HEADER_DIRENT, (continued)
- [Cvs-dev] Re: AC_HEADER_DIRENT, Derek R. Price, 2006/07/11
- [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT, Bruno Haible, 2006/07/11
- Re: [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT, Derek R. Price, 2006/07/11
- Re: [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT, Jim Hyslop, 2006/07/11
- Re: [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT, Paul Eggert, 2006/07/11
- Re: [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT, Derek R. Price, 2006/07/11
- Re: [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT, Paul Eggert, 2006/07/11
- new dirent module (was Re: [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT), Derek R. Price, 2006/07/12
- [Cvs-dev] Re: new dirent module, Derek R. Price, 2006/07/12
- Re: [Cvs-dev] Re: new dirent module, Derek R. Price, 2006/07/12
- [Cvs-dev] Re: new dirent module,
Jim Hyslop <=
- [Cvs-dev] Re: new dirent module, Derek R. Price, 2006/07/12
- [Cvs-dev] Re: new dirent module, Paul Eggert, 2006/07/12
- [Cvs-dev] Re: new dirent module, Derek R. Price, 2006/07/12
- Re: new dirent module (was Re: [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT), Bruno Haible, 2006/07/13
- Re: new dirent module (was Re: [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT), Derek R. Price, 2006/07/13
- Re: [Cvs-dev] Re: [bug-gnulib] AC_HEADER_DIRENT, Karl Berry, 2006/07/12
- Re: [Cvs-dev] Re: AC_HEADER_DIRENT, Derek R. Price, 2006/07/11
- Re: [Cvs-dev] Re: AC_HEADER_DIRENT, Jim Hyslop, 2006/07/11
- Re: [Cvs-dev] Re: AC_HEADER_DIRENT, Derek R. Price, 2006/07/11