Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!att!linac!kilroy!ekuns From: ekuns@kilroy.chi.il.us (Eddie Kuns) Newsgroups: comp.os.os9 Subject: Re: open() + sharable file = no disk Summary: I've gotten open to work with S_ISHARE Keywords: Sharable, open Message-ID: <43@kilroy.chi.il.us> Date: 12 Jun 91 02:49:47 GMT References: <1991Jun11.012640.904@tkou02.enet.dec.com> Distribution: usa Lines: 33 zambotti@wpowz.enet.dec.com (Walter Zambotti DEC) writes: >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). I've gotten this to work, as desired. As Zack, I'm using Carl Kreider's C library. Here is a short example: #include .... /* open the active file in non-sharable mode, read-write */ activepath = open(NGROUPS, S_IREAD | S_IWRITE | S_ISHARE); if (activepath == 0) { printf("readactive: can't open active file\n"); exit(0); } And this code works. (Other processes who open the file sleep until this process closes the file. They then awaken and can open the file.) I also use the Dev Sys RAM Disk, and haven't noticed any weird behavior with it. (The file I open above is not on the RAM disk.) My suggestion: If you're not using Carl Kreider's C library, you should get it. It may fix the above problem; it is much more capable, faster, and smaller.