using od on a directory

Hey folks

I am fiddling around with the od command. I referenced The UNIX Programming Environment, they could use od on a directory, which seems to make good sense. When I try though, it gives me this:

$ od -c .
od: .: read error: Is a directory
0000000
 $        

Is there a way I can get around this?

This is what I am using for od:

$ od --version
od (GNU coreutils) 6.4

Running x86_64 Gentoo with kernel 2.6.18.

There is no reasonable work around. The Linux kernel prohibits the read system call from working on directories.

Seems to be a problem of the GNU od.

Works fine on my Solaris system but get same error on a Linux box with GNU od

Well ok - thanks for the info to both of you. I suppose that pretty well solves the problem as to what is going on.

Now having looked at the man page for read on my machine, I see there is the error code EISDIR which also exists under FreeBSD, but it looks as though on FreeBSD that it depends on the file system itself whether or not you are allowed to read a directory or not.

From man (2) read : (FreeBSD man pages)

[EISDIR]		The file descriptor is associated with a directory
			residing on a file system that does not allow regular
			read operations on directories (e.g. NFS).

No indication in the Linux man page of anything of the same sort.