Re: LDPRs, LDPCs and the mysterious X

<pointless-pedantism>

To be pedantic, at the filesystem level directories _are_ files, as well as much of the plumbing above it. To prevent accidental oddness, SOME systems enforce a separate set of APIs for reading directories, and the Single UNIX Specification makes specific allowances for this:

[EISDIR]
[XSI]  The fildes argument refers to a directory **and the implementation does not allow** the directory to be read using read() or pread(). The readdir() function should be used instead.

(emphasis mine)

On many Unix-like systems, you can 'cat' a directory just fine, though what you'll get out of it will be just a set of binary dentries, so it probably won't get you too far.

</pointless-pedantism>

On Fri 2013-Jan-25, at 12:40, Andy Seaborne <andy.seaborne@epimorphics.com>
 wrote:

>
>
> On 25/01/13 11:33, Henry Story wrote:
>> everything including directories are files.
>
> Not really:
>
> cat / ==> "cat: /: Is a directory"
> echo $? ==> 1
>
> man 2 read:
> EISDIR
>    fd refers to a directory.
>
>       Andy
>

--
Mo McRoberts - Technical Lead - The Space
0141 422 6036 (Internal: 01-26036) - PGP key CEBCF03E,
Zone 1.08, BBC Scotland, Pacific Quay, Glasgow, G51 1DA
Project Office: Room 7083, BBC Television Centre, London W12 7RJ



-----------------------------
http://www.bbc.co.uk
This e-mail (and any attachments) is confidential and
may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in
error, please delete it from your system.
Do not use, copy or disclose the
information in any way nor act in reliance on it and notify the sender
immediately.
Please note that the BBC monitors e-mails
sent or received.
Further communication will signify your consent to
this.
-----------------------------

Received on Friday, 25 January 2013 12:48:54 UTC