Re: psql -f doesn't complain about directories

Поиск
Список
Период
Сортировка
От Zdenek Kotala
Тема Re: psql -f doesn't complain about directories
Дата
Msg-id 473B5B8D.6010801@sun.com
обсуждение исходный текст
Ответ на Re: psql -f doesn't complain about directories  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: psql -f doesn't complain about directories  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
Martijn van Oosterhout wrote:
> On Wed, Nov 14, 2007 at 05:15:20PM -0300, Alvaro Herrera wrote:
>>> Should we do some kind of stat() before opening the file and abort if it's a 
>>> directory?
>> Actually anything other than a plain file, right?  (Do we really want to
>> be able to psql -f a_pipe?)
> 
> Sure, why not. To be honest I think that psql shouldn't be ignoring the
> EISDIR error the kernel is returning.

But it works when you open directory in read-only mode. See posix 
definition:

[EISDIR]    The named file is a directory and oflag includes O_WRONLY or O_RDWR.

Zdenek


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: psql -f doesn't complain about directories
Следующее
От: Zdenek Kotala
Дата:
Сообщение: Re: psql -f doesn't complain about directories