🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
3 messages
3 total messages Started by Paul Rolland Tue, 16 Apr 1991 16:24
HPFS and IBM C/2
#2541
Author: Paul Rolland
Date: Tue, 16 Apr 1991 16:24
33 lines
1441 bytes
Hi networkers,

	I've experimented the following : when I used the IBM C/2 functions
fopen or open to open a file that is situated on an HPFS disk, I always
have a return code telling me that the file hasn't been found. If I just 
change in my program the disk to access a DOS disk, it works...

	So, is access to an HPFS disk impossible with fopen and open, and
will I be oblige to use the OS/2 DosOpen ? If not, what is the problem ?

Second problem, that is related : I did the following
#include <stdio.h>
#include <io.h>

void main(void)
{
  FILE * fd;

  fd=fopen("E:\\FILENAME","r");
  printf("Fopen done\n");
  fclose(fd);
  printf("fclose done\n");
}

But I never see the second message, I have a trap with a protection
violation before... Is it normal, with E being an HPFS disk ?

	Paul.

 Paul Rolland, engineer [I hope :)] in July 91,
 Specialist of assembly on PC [Not too bad in fact :)],
 Trying to progress on Unix administration
 					   Email : rol@grasp1.univ-lyon1.fr 
Re: HPFS and IBM C/2
#2542
Author: Alan Ballard
Date: Tue, 16 Apr 1991 17:31
21 lines
1669 bytes
In article <1991Apr16.162439.24649@grasp1.univ-lyon1.fr> rol@grasp1.univ-lyon1.fr (Paul Rolland) writes:
>	I've experimented the following : when I used the IBM C/2 functions
>fopen or open to open a file that is situated on an HPFS disk, I always
>have a return code telling me that the file hasn't been found. If I just 
>change in my program the disk to access a DOS disk, it works...

If the file you are trying to access has a name that wouldn't be a valid
FAT name (i.e., not 8.3), fopen won't find it *unless* you mark the 
program as "long name aware".  This is done via either an attribute 
in the .def file for the linker, or by running exehdr or markexe 
on the linked program.  
If this isn't the problem, I don't have any other ideas -- I've used fopen
on hpfs files without any trouble.




Alan Ballard                   | Internet: ballard@ucs.ubc.ca
University Computing Services  |   Bitnet: USERAB1@UBCMTSG
University of British Columbia |    Phone: 604-822-3074
Vancouver B.C. Canada V6R 1Z2  |      Fax: 604-822-5116
Re: HPFS and IBM C/2
#2572
Author: Dan SPALDING
Date: Wed, 24 Apr 1991 01:55
22 lines
1688 bytes
In article <1991Apr16.162439.24649@grasp1.univ-lyon1.fr> rol@grasp1.univ-lyon1.fr (Paul Rolland) writes:
>
>  fd=fopen("E:\\FILENAME","r");

didn't anyone tell you to check pointers for validity before using them?
the FILE* is null from fopen if the open failed.  check you errno for more
info.  maybe the file doesn't exist?  anyway, it shouldn't be a problem to
open a file on an hpfs drive.  it acts pretty much as a FAT drive would with
8.3 files.  you might make sure your .exe is marked with the "long filename"
support if the file you are trying to open is not 8.3.  the linker/def file
can be used to do this.  just add "NEWFILES" to the line with the program name
in the .def file.

------------------------------------------------------------------------
dan spalding -- microsoft systems/languages -- microsoft!dans
"there has not been a word invented that would convey my indifference to
that remark." - paraphrase from hawkeye pierce
-- 
------------------------------------------------------------------------
dan spalding -- microsoft systems/languages -- microsoft!dans
"there has not been a word invented that would convey my indifference to
that remark." - paraphrase from hawkeye pierce
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads