Re: A micro-optimisation for walkdir()
| От | Tom Lane |
|---|---|
| Тема | Re: A micro-optimisation for walkdir() |
| Дата | |
| Msg-id | 316705.1599057298@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | A micro-optimisation for walkdir() (Thomas Munro <thomas.munro@gmail.com>) |
| Ответы |
Re: A micro-optimisation for walkdir()
|
| Список | pgsql-hackers |
Thomas Munro <thomas.munro@gmail.com> writes:
> You don't need to call stat() just to find out if a dirent is a file
> or directory, most of the time. Please see attached.
Hm. If we do this, I can see wanting to apply the knowledge in more
places than walkdir(). Is it possible to extract out the nonstandard
bits into a reusable subroutine? I'm envisioning an API more or less
like
extern enum PGFileType identify_file_type(const char *path,
const struct dirent *de,
bool look_thru_symlinks);
regards, tom lane
В списке pgsql-hackers по дате отправления: