Re: Possibly OT: why doesn't od dump anything when given a directory as an arg?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 20, 2005 at 03:25:03PM +0530, Karthik Subramanian wrote:
> I was dusting my old copy of Kernighan & Pike, and I remembered
> working out most of the examples on an antiquated unix machine in
> engineering school. I decided to try out some just for kicks, and I
> discovered something:
> 
> In page 51 of K&P, there's an example that runs od on a directory, and
> the dump actually shows the filenames. I tried doing that (running 'od
> .' ) on my linux box, and got this instead:
> 
> od: .: Is a directory
> 0000000
> 
> So why doesn't od work on directories? Could somebody shed some light
> on this, please!

od doesn't open(2) the file with the O_DIRECTORY flag, see "man 2 open"
for an explanation.


Erik

-- 
Erik Mouw
J.A.K.Mouw@xxxxxxxxxxxxxx  mouw@xxxxxxxxxxxx

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux