Message-Id: <9710010022.AA04532@free.polbox.pl> From: "=?ISO-8859-2?Q?Robert_Darmochwa=B3?=" To: "DJGPP Mailing List" Subject: how to get filesize,and similiar problems. Date: Tue, 30 Sep 1997 22:18:13 +0100 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_01BCCDEE.BE3CD6E0" Content-Transfer-Encoding: 7bit Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_01BCCDEE.BE3CD6E0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_01BCCDEE.BE3CD6E0" Content-Transfer-Encoding: 7bit ------=_NextPart_001_01BCCDEE.BE3CD6E0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit hi! here is how i handle fileio: instead of opening ,handles etc. i have simple ' file *loadfile() 'function. maybe my two lame source code files will be helpfull. man2die4 AT earthling DOT net ------=_NextPart_001_01BCCDEE.BE3CD6E0 Content-Type: text/html; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable

hi!
here is how i handle = fileio:
instead of opening ,handles etc. i have simple '  file = *loadfile() 'function.
maybe my two lame source code files will be = helpfull.

man2die4 AT earthling DOT net


------=_NextPart_001_01BCCDEE.BE3CD6E0-- ------=_NextPart_000_01BCCDEE.BE3CD6E0 Content-Type: application/octet-stream; name="Fileio.c" Content-Transfer-Encoding: 7bit Content-Description: Fileio.c (C Plik) Content-Disposition: attachment; filename="Fileio.c" #include #include #include unsigned int FileSize(char *name) {struct stat s; stat(name,&s); return(s.st_size); }; void *LoadFile(char *name) {int h; unsigned int size; void *pntr; int opresult; _dos_open(name,2,&h); size=FileSize(name); pntr=(void *) calloc(1,size); _dos_read(h,pntr,size,&opresult); _dos_close(h); return pntr; } void WriteFile(char *name,void *dat,int count) { } void *IniPtr; void AssignIniFile(char *fn) { if (IniPtr) free(IniPtr); IniPtr=LoadFile(fn); } char *IniString; ------=_NextPart_000_01BCCDEE.BE3CD6E0 Content-Type: application/octet-stream; name="Fileio.h" Content-Transfer-Encoding: 7bit Content-Description: Fileio.h (H Plik) Content-Disposition: attachment; filename="Fileio.h" extern void *LoadFile(char *name); extern unsigned int FileSize(char *name); ------=_NextPart_000_01BCCDEE.BE3CD6E0-- -- [ REKLAMA / ADVERTISEMENT ] ------------------------ WPADNIJ, ZEBY NIE WPASC! http://www.ako2.com.pl -------------------------------------------------------