Re: readdir is incorrectly implemented at Windows

Поиск
Список
Период
Сортировка
Искать
От
Michael Paquier
Тема
Re: readdir is incorrectly implemented at Windows
Дата
Msg-id
20190228021553.GG1617@paquier.xyz
Ответ на
Список
Дерево обсуждения
readdir is incorrectly implemented at Windows Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: readdir is incorrectly implemented at Windows Michael Paquier <michael@paquier.xyz>
Re: readdir is incorrectly implemented at Windows Michael Paquier <michael@paquier.xyz>
Re: readdir is incorrectly implemented at Windows Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
Re: readdir is incorrectly implemented at Windows Michael Paquier <michael@paquier.xyz>
Re: readdir is incorrectly implemented at Windows Michael Paquier <michael@paquier.xyz>
Re: readdir is incorrectly implemented at Windows Grigory Smolkin <g.smolkin@postgrespro.ru>
Re: readdir is incorrectly implemented at Windows Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
On Mon, Feb 25, 2019 at 06:38:16PM +0300, Konstantin Knizhnik wrote:
> Small issue with readir implementation for Windows.
> Right now it returns ENOENT in case of any error returned by FindFirstFile.
> So all places in Postgres where opendir/listdir are used will assume that
> directory is empty and
> do nothing without reporting any error.
> It is not so good if directory is actually not empty but there are not
> enough permissions for accessing the directory and FindFirstFile
> returns ERROR_ACCESS_DENIED:

Yeah, I think that you are right here.  We should have a clean error
if permissions are incorrect, and your patch does what is mentioned on
Windows docs:
https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea

Could you add it to the next commit fest as a bug fix please?  I think
that I will be able to look at that in details soon, but if not it
would be better to not lose track of your fix.
--
Michael
В списке pgsql-hackers по дате отправления
От: Tsunakawa, Takayuki
Дата:
От: Amit Langote
Дата:
FAQ