*BSD News Article 65503


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!news.ysu.edu!usenet.ins.cwru.edu!gatech!newsfeed.internetmci.com!in1.uu.net!news.artisoft.com!usenet
From: Terry Lambert <terry@lambert.org>
Newsgroups: comp.os.linux.development.system,comp.unix.bsd.freebsd.misc
Subject: Re: Ideal filesystem
Date: 10 Apr 1996 06:52:30 GMT
Organization: Artisoft, Inc.
Lines: 103
Message-ID: <4kflre$dgs@coyote.Artisoft.COM>
References: <4hptj4$cf4@cville-srv.wam.umd.edu> <3140C968.20699696@netcom.com> <4istou$ri9@floyd.sw.oz.au> <4j0bmo$ftv@park.uvsc.edu> <jlemonDoqBq5.1Bx@netcom.com> <4jerrj$f12@park.uvsc.edu> <4joiil$r75@narses.hrz.tu-chemnitz.de> <4jvi4i$oim@park.uvsc.edu> <DpDswJ.A96@pe1chl.ampr.org>
NNTP-Posting-Host: hecate.artisoft.com
Xref: euryale.cc.adfa.oz.au comp.os.linux.development.system:20992 comp.unix.bsd.freebsd.misc:16994

rob@pe1chl.ampr.org (Rob Janssen) wrote:
]
] In <4jvi4i$oim@park.uvsc.edu> Terry Lambert <terry@lambert.org> writes:
] 
] >If you have to search each potential executable as a directory
] >to see if it has an "a.out" (executable file) "fork", then
] >you have increased the search time one order of magnitude on
] >an expotential curve (directories rarely contain one file).
] 
] No, you don't have to search each directory.
] The shell also isn't opening each file with the x bit set to see
] if it really is an executable.  This is deferred until the command is
] actually ussued.  When the file turns out to be not an executable after
] all (bad magic number), this failure is reported *at execution time*.

Current file-as-file, hash on file:
exec csh
set path = (~/bin $path)
cd
mkdir -f bin
cd bin
mkdir ls
chmod 755 ls
cd
rehash
ls
[listing of files -- no screwup]

Your file-as-dir, hash on dir:
exec csh
set path = (~/bin $path)
cd
mkdir -f bin
cd bin
mkdir ls
chmod 755 ls
cd
rehash
ls
ls: Command not found

Your file-as-dir, hash on a.out in dir:
exec csh
set path = (~/bin $path)
cd
mkdir -f bin
cd bin
mkdir ls
chmod 755 ls
cd
rehash
ls
[list of files -- no screwup]


BTW: as predicted, this mod took about 8 minutes for the exec
loader change, the csh hash changes, and the sys/ufs/ufs changes
to put an "dir is command" attribute on directories when a.out
is created in a dir).

Total time with compilation, reboot, and tests above: 30 minutes.

BTW: hacking the flag onto the directory was not the correct
way to implement the "dir is executable", but I was lazy on
the attribute setting code and wanted to keep the "file as
executable" behaviour instead of converting my entire system.

This is not what I'd call FS research (well, I used my tools
that I use for *real* FS research to blow the bits back to
zero before restoring my csh and the old kernel).  This is just
simple hackery, and it won't do crap for letting me FTP a
"new format" binary as a file.

Plus there is all the obnoxious hacking for the linker, etc.

] Similarly, any directory found in the directories named in the path can
] just be added to the hash list, and the presence of an executable
] program in that directory need only be determined when the command is
] actually issued.

Fallback on error us inacceptable, for a lot of reasons... for one,
the error may be an intentional administrative decision.


] Of course there usually are no subdirectories in directories named in
] the path, so this isn't really an issue anyway.  When a directory is
] used to contain executable program information, it can quite safely be
] assumed that any directory contains an executable.

I want forks on my files, too.  I want to store architecture
specific data in my /etc/hosts.conf file.  8-).

I want to add a "managers note" to a company wide attachment to
an email so that the managers can read it and the general users
can't.

I want things that I don't know that I want yet, but will.  8-).

                                        Terry Lambert
                                        terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.