🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1777

gcc (emx version) and long filenames.

#1777
From: Jack Viktor Loekken
Date: Sun, 08 Nov 1992 04:55
55 lines
1839 bytes
I am having trouble with gcc (emx version) and long filenames on
HPFS partition.

example :

#include <stdio.h>

void main()
{
FILE *f1,*f2,*f3,*f4;

	f1 = fopen ("this.file.already.exists","rb");
	f2 = fopen ("this_file_also_exists","rb");
	
	f3 = fopen ("this.file.should.be.created","wb");
	f4 = fopen ("so_should_this_file","wb");

	if (!f1)
	  printf ("\nUnable to open <this.file.already.exists>");

	if (!f2)
	  printf ("\nUnable to open <this_file_also_exists>");

	if (!f3)
	  printf ("\nUnable to create <this.file.should.be.created>");

	if (!f4)
	  printf ("\nUnable to create <so_should_this_file>");

	/** do some processing **/
	fcloseall();
}

The program prints out : 

	Unable to open <this.file.already.exists>

even (as the filename implies) it does exist. Also, instead
of creating the file 'this.file.should.be.created', it creates the
file 'this.fil.sho.be.cre'. The filenames that did not contain periods
were handled correctly.

The program was compiled with the command line :

gcc -o test.exe test.c

Then I tried the following compile commandline :

gcc -o test.exe test.c /emx/lib/io/open.c /emx/lib/sys/seterrno.c -los2

This time the program behaved correctly. Can anybody explain this ?
I assume that the I/O functions resides in the dll's, but I haven't
found out how to rebuild these. Anybody knows ?

Jack
Technical Details
Message-ID: <1992Nov8.045519.17076@CSD-NewsHost.Stanford.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!CSD-NewsHost.Stanford.EDU!Xenon.Stanford.EDU!loekken

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!CSD-NewsHost.Stanford.EDU!Xenon.Stanford.EDU!loekken
From: loekken@Xenon.Stanford.EDU (Jack Viktor Loekken)
Subject: gcc (emx version) and long filenames.
Message-ID: <1992Nov8.045519.17076@CSD-NewsHost.Stanford.EDU>
Sender: news@CSD-NewsHost.Stanford.EDU
Organization: Computer Science Department, Stanford University.
Date: Sun, 8 Nov 1992 04:55:19 GMT
Lines: 56