C (27/178)

From:Nick Lamburn
Date:12 Jul 2000 at 16:48:40
Subject:ExamineFH() Problems

Hello

I am currently writing a routine to read a file (currently fixed to
s:shell-startup just for testing purposes) and get its size so that I can
allocate a buffer to hold this text in.

Now, I understand you have to use ExamineFH() from the dos.library; and
indeed it works - except that when i click on to my program's window or
anywhere else for that matter - the computer completely freezes up requiring
a reboot.

I understand that the FileInfoBlock structure has to be longword aligned and
I think this is where my problem lies; however - i don't know how to do
this, as using say: file_info=1L<<file_info does not work in SAS/C 6.57 :)
It probably wouldn't work anyway since i'm not totally 'au fait' with bit
shifting and such like.

I have *attached* the code segment.

It is becoming very aggrevating because I have to know the file's size so
that the correct amount of memory is allocated.

Thanks in advance.

All the best,

Nick.



:+ ooO :O-
=- -=- OO8.:8 --------------------------------------.
= ..: oOO8::88 |
+ . -O88=.-8 Trogladite Software |
=-. .-==+ ...888= |
.=- ..-==o ..:888=: http://www.trogsoft.org |
.+== :-==+o..::888== |
O ===-- ..8888:--88 �������������������������������� |
OO o++++ .....8888:--8: Nick Lamburn - Dept. Manager |
.8. OOo8.....:8888--o8 ��������������������������������� |
-:O8 88888=::-888= oruk_amigan@btinternet.com |
==88...88888::-o88= nick@trogsoft.org |
| oOOo+=oooO+OOOO= |
| -Oo8O==88=8 Boing Ball is a � of Amiga Inc. |
`----------------------------------------------------------'
------------------------------------------------------------------------
Are you paying too much for your International Calls? Join beMANY!
and pay less each month. Our huge buying group gives you Long Distance
rates which fall automatically!
http://click.egroups.com/1/6588/1/_/451227/_/963413402/
------------------------------------------------------------------------