Mail Archives: djgpp/2001/06/05/05:55:00
Hi
This is a bug report for RHIDE Version 1.4.7.8 (Nov 10 2000 21:25:40)
I am running MS-DOS 5.0
Important environment variables:
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\WBEM;C:\DJGPP\BIN
DJGPP=C:\DJGPP\DJGPP.env
DJDIR=c:/djgpp
LFN=y
INFOPATH=c:/djgpp/info;c:/djgpp/gnu/emacs/info
LOCALEDIR=
LANGUAGE=
SHELL=
COMSPEC=C:\WINNT\SYSTEM32\COMMAND.COM
DJSYSFLAGS=
My problem is the following:
============================
I am running RHIDE in a windows NT DOS window.
When running the debugger on a program using fopen(), it seems that fopen()
of readonly files will only return NULL. The file "in.txt" exists in the
same directory as the application and has not been held onto by any Windows
apps.
Consider the following code:
/* bug?.c
Test fopen() ???? */
#include <stdio.h>
int main()
{
FILE *file_ptr_read;
FILE *file_ptr_write;
file_ptr_read = fopen( "in.txt", "r" );
printf("fopen() allocated the readonly pointer %d\n\n", file_ptr_read);
fclose(file_ptr_read);
file_ptr_write = fopen( "out.txt", "w" );
printf("fopen() allocated the writeonly pointer %d\n\n", file_ptr_write);
fclose(file_ptr_write);
exit(0);
}
When this code is compiled and run, it does what is expected. The output is
"""""
fopen() allocated the readonly pointer 590148
fopen() allocated the writeonly pointer 590148
"""""
However when a breakpoint is inserted the code returns the following
"""""
fopen() allocated the readonly pointer 0
fopen() allocated the writeonly pointer 590148
"""""
===============================
Anybody with a solution/work around so that I can debug my own code [it
relies on reading the file !!] ?:)
Thanks
Scott
- Raw text -