home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.28 / text0029.txt < prev    next >
Encoding:
Text File  |  1992-08-17  |  3.1 KB  |  70 lines

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