Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jun 2009 09:04:40 +0200
From:      Thomas Backman <serenity@exscape.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   FS utils treates directories as files?
Message-ID:  <B7437F9F-A8BF-4F49-AAE4-9B93B62B6223@exscape.org>

next in thread | raw e-mail | index | archive | help

FreeBSD 8.0-CURRENT r193521 (Jun 5), bash:
[root@chaos /usr/ports]# file /
/: directory
[root@chaos /usr/ports]# cat /
�g��=[root@chaos /usr/ports]#
[root@chaos /usr/ports]# cat /usr/ports/mail
�
�
��9���Makefile�@abook�@adcomplain2�@althea�@addresses- 
goodies=�@annoyance-filterF�@anomy-sanitizerN�@antivirus- 
milterX�@anubisf�@archivemailm�@[root@chaos /usr/ports]#

Mac OS X 10.5, bash:
serenity@macbookpro ~ $ cat /
cat: /: Is a directory

Linux, bash:
(21:34) serenity@exscape ~ $ cat /
cat: /: Is a directory

The same applies to most FS utilities. Is this a feature or not? I  
find it pretty darn weird.

[root@chaos /usr/ports]# cat /etc
�_�=    syslog.conf
[root@chaos /usr/ports]# less /etc
/etc is a directory
[root@chaos /usr/ports]# more /etc
^ 
C 
^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@< 
80 
 > 
_ 
^ 
R 
< 
EA 
 > 
= 
^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@       
^ 
E 
^ 
@^ 
@^ 
@^ 
@^ 
@^ 
@^@^@^@^@^@^@syslog.conf^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
[root@chaos /usr/ports]# grep syslog /etc
Binary file /etc matches
[root@chaos /usr/ports]# tail /etc
�_�=    syslog.conf
[root@chaos /usr/ports]# head /etc
�_�=    syslog.conf
[root@chaos /usr/ports]#

Regards,
Thomas


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B7437F9F-A8BF-4F49-AAE4-9B93B62B6223>