delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/09/11:50:17

From: Bernhard Baeumle <bb AT ife DOT ee DOT ethz DOT ch>
Newsgroups: comp.os.msdos.djgpp
Subject: Desperately need help with "fopen"
Date: Wed, 09 Apr 1997 10:42:51 +0200
Organization: Electronics Lab
Message-ID: <334B568B.DBF@ife.ee.ethz.ch>
NNTP-Posting-Host: quincy.ee.ethz.ch
Mime-Version: 1.0
Lines: 35
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello.

I wrote about this problem already 2 weeks ago. I still have no solution
and the problem really seems to be with djgpp's 'fopen()' function!

fopen("test.txt", "r") returns NULL as long as I have this file
("test.txt") opened with MS Word for Windows. Other programs (emacs,
editor, notepad and DOS' type) have no problem reading the file!!! As
soon as I close the file (it's no longer opened with Word) then
fopen("test.txt", "r") works fine!

It seems there is some file-locking (sharing) mechanism with Win95 but
shouldn't it be possible to open the file for reading?????????

BTW:
- I use djgpp-v2 (gcc version 2.7.2.1) and run it in a DOS-box under
Windows95.
- I use emacs and have no such problems, but some people that use my
program would like to write the input-files (script-files) with Word ;-(
Some users (beginners) need to play around with my program which means
that they'd like to write e.g. 5 characters / save the file / run my
program and then make the next changes to the file. Just imagine the
amount of time it takes to CLOSE and then RE-OPEN the file with Word,
and they also need to find the correct line again...

I'D REALLY APRECHIATE VERY MUCH IF YOU COULD HELP ME!!!!!

Beni.
+-----------------------------------+-------------------------------+
| Bernhard Baeumle                  |                               |
| Swiss Federal Inst. of Technology | Phone: (+41) 1 632 51 53      |
| Electronics Lab, ETZ H60.1        | FAX  : (+41) 1 632 12 10      |
| Gloriastr. 35                     | Email: bb AT ife DOT ee DOT ethz DOT ch      |
| 8092 Zuerich (SWITZERLAND)        | http://www.ife.ee.ethz.ch/~bb |
+-----------------------------------+-------------------------------+

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019