Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!tkou02.enet.dec.com!wpowz!zambotti From: zambotti@wpowz.enet.dec.com (Walter Zambotti DEC) Newsgroups: comp.os.os9 Subject: open() + sharable file = no disk Message-ID: <1991Jun11.012640.904@tkou02.enet.dec.com> Date: 11 Jun 91 01:26:40 GMT Sender: usenet@tkou02.enet.dec.com (USENET News System) Reply-To: zambotti@wpowz.enet.dec.com (Walter Zambotti DEC) Organization: Digital Equipment Corporation Lines: 52 Hi there, I having a small problem with the open() system call. I'm using a CoCo III OS9 Lvl 2 with the level 1 C compiler. When I open a file with the open mode OR'd with 0x40 (64 dec) which is supposed to be the shareable attribute. The disk loses all directory information and I affectatively wipe out my entire disk. This is even the case regardless of the file I open (dir or normal file). Now I have been testing this code on the Tandy Developement pack RAMDISK (/r0) and this could possibly be just the ramdisk driver screwing up. Of course I'm not game to try this on my normal disk as this would be silly. Anyone care to comment? Here is my test code : --------------------------tstmod.c----------------------------- /* tstmod.c example (open file with read/write/shareable modes) : tstmod myfile 67 */ main(argcnt, argval) int argcnt ; char *argval[] ; { int file ; extern int errno ; if(argcnt != 3) { writeln(1, "tstmod file/dir open_mode\n", 80) ; exit(0) ; } if((file = open(argval[1], atoi(argval[2]))) == -1) { writeln(1, "bad file mode\n", 80) ; exit(errno) ; } else { writeln(1, "file mode ok!\n", 80) ; } close(file) ; }