Re: psql -f doesn't complain about directories - Mailing list pgsql-hackers

From Zdenek Kotala
Subject Re: psql -f doesn't complain about directories
Date
Msg-id 473C1E7E.5030001@sun.com
Whole thread Raw
In response to Re: psql -f doesn't complain about directories  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Martijn van Oosterhout napsal(a):
> On Wed, Nov 14, 2007 at 09:33:17PM +0100, Zdenek Kotala wrote:
>>> 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.
> 
> $ strace psql -f /tmp
> <snip>
> open("/tmp", O_RDONLY|O_LARGEFILE)      = 4
> <snip>
> read(4, 0xb7f1b000, 4096)               = -1 EISDIR (Is a directory)
> 
> Which is subsequently ignored. I'm hoping it doesn't ignore other
> errors, like EIO or EPIPE, 

Yes, you have right I checked only open command which works fine, but read fails.
Zdenek


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Simplifying Text Search
Next
From: Alvaro Herrera
Date:
Subject: Re: LDC - Load Distributed Checkpoints with PG8.3b2 on Solaris