🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #675

altering pathnames

#675
From: Michael I Bushnell
Date: Fri, 28 Aug 1992 12:46
44 lines
2314 bytes
   Resent-Date: Fri, 28 Aug 1992 08:13:18 -0400
   Date: Fri, 28 Aug 1992 08:13:18 -0400
   From: karl@claude.cs.umb.edu (Karl Berry)
   Sender: gnulists@ai.mit.edu
   Resent-From: bug-gnu-utils-request@prep.ai.mit.edu

   I don't understand the argument that we don't know what
   / means to the kernel.  / means what we all know it means.

Clearly not, because / at the end of a directory causes a failure if
it's just a file, and this is important.  The file utilities assume
that nobody cares about this distinction, or that they just don't know
about it.

   I don't think it's fruitful for the GNU file utilities
   to worry about running under non-Unix-like operating systems.
   Or is this not what you're thinking about?

It's running on the kernel that we care about, and it's here that the
file utilities *remove* a useful bit of functionality.

   Thomas, you seem to be worried about some abstract principle.
   I agree with the principle (in principle); in practice,
   I want the programs to work in the most convenient way,
   i.e., completion appending a / automatically, and
   the fileutils stripping off the / automatically.

The "most convenient way" as I see it is for the program to act as a
simple program which executes a simple system call.  

   Is there a practical problem that my suggested solution
   (of only stripping the / when the path is a directory)
   does not solve?

Yes.  If the file is changed from a directory to an ordinary file
between the stat and the rename, then the (new) file gets obliterated.
The original semantics guarantee (because they rely on the kernel to
make this decision) a certain measure of atomicity.

The general idea is that programs should not be more clever than the
kernel, thus, you get a system with only one set of rules to remember
instead of two.

	-mib
Technical Details
Message-ID: <9208282046.AA12596@wookumz.gnu.ai.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gnu.ai.mit.edu!mib
References: <199208281213.AA08508@claude.cs.umb.edu>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gnu.ai.mit.edu!mib
From: mib@gnu.ai.mit.edu (Michael I Bushnell)
Subject: altering pathnames
Message-ID: <9208282046.AA12596@wookumz.gnu.ai.mit.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
References: <199208281213.AA08508@claude.cs.umb.edu>
Distribution: gnu
Date: Fri, 28 Aug 1992 12:46:21 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 47