[comp.os.os2.programmer] HPFS and IBM C/2: opening files

rol@grasp1.univ-lyon1.fr (Paul Rolland) (04/17/91)

Hi Networkers,

	This is the third part of my adventures with OS/2... I asked you 
yesterday about a way to access files on an HPFS disk with IBM C/2. I've
been answered to:
  - define PROTMODE in my .DEF file used at link time  or
  - change the header with exehdr or another tools.
Here are the results:
  - PROTMODE has no effect, except changing the value of the bytes at 
    offset 88H and 8Ch.
  - I don't have either exehfr ot the other tool.

So, I still have a SYS1943: A program caused a protection violation when
I try to open a file whose name is DEBUG.TEST on my HPFS disk with fopen.

  HELP !!!! What have done that is wrong ? What am I supposed to install ?

	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 

ballard@cheddar.ucs.ubc.ca (Alan Ballard) (04/17/91)

In article <1991Apr17.110322.17440@grasp1.univ-lyon1.fr> rol@grasp1.univ-lyon1.fr (Paul Rolland) writes:
>  - I don't have either exehdr ot the other tool.
I also suggested you could use the DEF file to set the long names 
attribute; if you don't have exehdr (are you sure?), then use the 
def file line:
   NAME test NEWFILES
This assumes you have a new enough version of the linker to support 
HPFS attributes.
>So, I still have a SYS1943: A program caused a protection violation when
>I try to open a file whose name is DEBUG.TEST on my HPFS disk with fopen.
I don't know why it should cause a protection violation. Maybe you 
have an old library that doesn't understand HPFS (I wonder if it tries to 
copy the filename?)

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

wbonner@yoda.eecs.wsu.edu (Wim Bonner) (04/18/91)

In article <1991Apr17.110322.17440@grasp1.univ-lyon1.fr> rol@grasp1.univ-lyon1.fr (Paul Rolland) writes:
>Hi Networkers,
>
>	This is the third part of my adventures with OS/2... I asked you 
>yesterday about a way to access files on an HPFS disk with IBM C/2. I've
>been answered to:
>  - define PROTMODE in my .DEF file used at link time  or

What you need to add to your .DEF file is an option on the NAME line.

make it so that the line reads something like the following:
NAME [appname] [apptype] NEWFILES

and it should be able to deal with Long File names.  I pulled this from the help
I got when I typed LINK /HELP, looked at the command options, then Name
Application Type, then another submenu, the NAME statement.

Hope that this helps..

Wim.
-- 
|  wbonner@yoda.eecs.wsu.edu  | The Loft BBS
| 27313853@wsuvm1.csc.wsu.edu | (509)335-4339
|  72561.3135@CompuServe.com  | USR HST Dual Standard HST/V.32

gah@hood.hood.caltech.edu (Glen Herrmannsfeldt) (04/18/91)

The sys... message is not a regular hardware style
protection violation.  It sounds more like file
protection.  Maybe it is a read only file that is
opened for write, or something similar.  Or maybe
it just thinks it is.

--- glen