directory copying with cp; broken?

Mike Sullivan mike_s at yavin.uucp
Sat Oct 8 04:42:32 AEST 1988


In article <506 at quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
>In article <30506 at bbn.COM> mesard at bbn.com (Wayne Mesard) writes:
>>Indeed.  And more generally, a consistent way of handling directories
>>(i.e. directory files) needs to be established.  In SunOS 3.4:
>>  head, tail, cat <dir>     ==>  {works}
>
>Are you sure about that?  In both SunOS 3.2 and SunOS 4.0,
>	% cat .
>	cat: read error: Is a directory
>In straight 4.2BSD, if you read a directory, you get the file names &c,
>but in SunOS 3.x and 4.x, a directory always appears to be empty.  So
>"wc $Directory" in SunOS will always print "0 0 0".

I am running SunOS 4.0, and if I 'cat .' I get the contents of the
directory (file names, etc.), not a read error. "wc ." also works, 
printing "1 7 1024" (for a 2 block directory). Both also work under
3.5. There is a portable directory interface, and you are not 
supposed to be able to directly open directories (great sentence), 
but apparently you still can.


	Mike

sun!yavin!mike_s



More information about the Comp.unix.wizards mailing list