Article View: comp.sys.atari.st
Article #40185Double open file warning
From: Allan Pratt
Date: Tue, 09 Jan 1990 23:57
Date: Tue, 09 Jan 1990 23:57
23 lines
1418 bytes
1418 bytes
Talking with Dale Schumacher led to the following concise warning: If the same file is open more than once, it's trouble. That is, if you Fopen a file, then Fopen it again without calling Fclose on the first handle first, you are courting disaster. When either handle is Fclosed, using the other one might or might not lead to any sensible results. This ESPECIALLY applies to having the same file open by two different processes: if you Fopen a file, then Pexec a child, and that child Fopens the same file, you're in deep doo-doo. When the child Fcloses the file, or Pterms (which closes all its files), the handle in the parent might or might not refer to anything sensible. Fdup and Fforce suffer from the same problems. It's all in the data structures which turn handles into files and eventually into blocks on disk. They're done wrong. This is true for all existing TOSes: 1.0, 1.2, 1.4, and 1.6. ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt
Technical Details
Message-ID:
<1939@atari.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!portal!atari!aprattShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!portal!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Double open file warning Message-ID: <1939@atari.UUCP> Date: 9 Jan 90 23:57:17 GMT Organization: Atari Corp., Sunnyvale CA Lines: 23