home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: peter@ferranti.com (Peter da Silva)
-
- In article <11r3dbINN6q7@ftp.UU.NET> gwyn@smoke.brl.mil (Doug Gwyn) writes:
- > Submitted-by: gwyn@smoke.brl.mil (Doug Gwyn)
- >
- > In article <11k9bsINN6n9@ftp.UU.NET> peter@ferranti.com (Peter da Silva) writes:
- > >A better design still would be to make the current directory a standard
- > >file descriptor, ...
- >
- > Well, yes, that's an interesting approach. One problem is that it
- > would require (at the program/OS interface level) that open() of any
- > directory work properly, which currently isn't guaranteed in some
- > implementations.
-
- Yes, you would need to implement an "O_DIR" mode that would work on any
- directory, though the behaviour of read() and write() on a file with O_DIR
- only would be undefined.
-
- > Anyway, my strategic concern is that we look to improved design to
- > solve problems rather than worry excessively about making existing
- > inferior designs work marginally better.
-
- I can accept that goal, I'd just like to point out that your suggestion
- (was it your suggestion?) that the operating system track current working
- directory is not necessarily an improved design. It simplifies one
- particular operation that is not frequently used (and in fact only need
- ever be called once by any given program) and complicates a number of
- other things (for example, having two programs call getcwd() and return
- different values). In addition, it can be easily emulated in the runtime
- if you *do* want to do it simply by caching the first getcwd() and then
- tracking changes to it. My suggestion is more generally useful, and also
- makes getcwd() simpler to implement. In my opinion, that makes it a superior
- design.
-
- > >I also think argv and envp should be passed in on yet another standard
- > >file descriptor as well... let's simplify the design rather than complicate
- > >it.
-
- > Unfortunately the C standard has locked in argv.
-
- crt0 can extract an argv from stdcmd.
-
- Another advantage of stdcmd is that programs that are written for it can
- accept multiple sets of arguments on it, allowing interactive control. This
- would be extremely useful for a windowing shell, plus it would obviate the
- need for xargs and similar kludges.
-
- > (You're not supposed
- > to use envp.) The environment could also be implemented as /dev/env/*
-
- This is actually how it's implemented on the Amiga. In fact, the initial
- intent was that ENV: would be a special purpose file system, but it turns out
- that simply assigning ENV: to RAM:ENV works as well on a single-user system.
- This is the sort of nice trade-off you get when you can go back to basics.
-
- > For the curious, Apple's ProDOS and GS/OS implement path prefixes,
- > and I've layered support for UNIX conventions (/, .., .) into my
- > edition of the standard C library.
-
- So other people's programs don't see these conventions?
- --
- Peter da Silva `-_-'
- $ EDIT/TECO LOVE 'U`
- Ferranti International Controls Corporation Have you hugged
- Sugar Land, TX 77487-5012 +1 713 274 5180 your wolf today?
-
-
- Volume-Number: Volume 28, Number 30
-
-