FS utils treates directories as files?

From: Thomas Backman <serenity_at_exscape.org>
Date: Tue, 9 Jun 2009 09:04:40 +0200
FreeBSD 8.0-CURRENT r193521 (Jun 5), bash:
[root_at_chaos /usr/ports]# file /
/: directory
[root_at_chaos /usr/ports]# cat /
�g��=[root_at_chaos /usr/ports]#
[root_at_chaos /usr/ports]# cat /usr/ports/mail
�
�
��9���Makefile�_at_abook�_at_adcomplain2�_at_althea�_at_addresses- 
goodies=�_at_annoyance-filterF�_at_anomy-sanitizerN�_at_antivirus- 
milterX�_at_anubisf�_at_archivemailm�_at_[root_at_chaos /usr/ports]#

Mac OS X 10.5, bash:
serenity_at_macbookpro ~ $ cat /
cat: /: Is a directory

Linux, bash:
(21:34) serenity_at_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_at_chaos /usr/ports]# cat /etc
�_�=    syslog.conf
[root_at_chaos /usr/ports]# less /etc
/etc is a directory
[root_at_chaos /usr/ports]# more /etc
^ 
C 
^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_< 
80 
 > 
_ 
^ 
R 
< 
EA 
 > 
= 
^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_
^_at_^_at_^_at_^_at_^_at_^_at_       
^ 
E 
^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^ 
_at_^_at_^_at_^_at_^_at_^_at_^_at_syslog.conf^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_^_at_
[root_at_chaos /usr/ports]# grep syslog /etc
Binary file /etc matches
[root_at_chaos /usr/ports]# tail /etc
�_�=    syslog.conf
[root_at_chaos /usr/ports]# head /etc
�_�=    syslog.conf
[root_at_chaos /usr/ports]#

Regards,
Thomas
Received on Tue Jun 09 2009 - 05:05:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:49 UTC