Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!agate!pasteur!ames!elroy!spl1!laidbak!katzung From: katzung@laidbak.UUCP (Brian Katzung) Newsgroups: comp.os.minix Subject: Re: new and improved freopen.c (I hope) Summary: Bugs, extensions, 1 opinion on naming Message-ID: <1782@laidbak.UUCP> Date: 14 Nov 88 17:09:03 GMT References: <260@cst.UUCP> Reply-To: katzung@laidbak.UUCP (Brian Katzung) Organization: Lachman Associates, Inc., Naperville, Illinois Lines: 45 In article <260@cst.UUCP> meulenbr@cst.UUCP (Frans Meulenbroeks) writes: >X#define PMODE 0644 Shouldn't this be 0666 so that umask can be used to get the desired mode? >X flags = flags & !WRITEMODE & !READMODE; That sets all bits to zero (perhaps those are network-mangled tildas??). I believe you meant flags &= ~(WRITEMODE | READMODE); >X case 'a': >X flags |= WRITEMODE; >X if (( fd = open(name,1)) < 0 ) >X return((FILE *)NULL); >X lseek(fd,0L,2); >X break; Append is really two attempts: if ((fd = open(name, 1)) < 0 && (fd = creat(name, PMODE)) < 0) return ((FILE *) NULL); Does Minix support O_APPEND mode? If not, perhaps there needs to be an APPENDMODE bit (see flame below) to achieve nearly the same effect. The only reference I have handy right now (SVID) guarantees writes at the end. Do the original routines support r+, w+, and a+ modes? These are nice to have. I'm not near a Minix machine at the moment. Does Minix support open with 3 arguments? This would make an implementation a little easier/cleaner. >Frans Meulenbroeks (meulenbr@cst.prl.philips.nl) > Centre for Software Technology > ( or try: ...!mcvax!philmds!prle!cst!meulenbr) VERY small flame/spark (but not aimed at Frans) on a related topic: Aren't READMODE and WRITEMODE rather "central" in the name-space for "semi-invisible" definitions? It seems to me that something like _SIO_READ and _SIO_WRITE might have been a bit less likely to collide with application definitions. -- Brian Katzung ...!spl1!laidbak!katzung