Raised This Month: $51 Target: $400
 12% 

Read Binary File


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tripc
Senior Member
Join Date: Aug 2006
Old 11-05-2010 , 09:10   Read Binary File
Reply With Quote #1

Hi,

I need to read binary file, how can I do that?

The code below doesn't work:
PHP Code:
#define DATA_SIZE 1024

new filebuff[DATA_SIZE];
if(!(
file fopen("file""rb"))) return false;
while(!
feof(file)) {
 
fgets(filebuffsizeof(buff)-1);
}
fclose(file); 

Last edited by tripc; 11-05-2010 at 09:23.
tripc is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-05-2010 , 15:26   Re: Read Binary File
Reply With Quote #2

Be patient my friend, I will try to get the code to you possibly tonight or over the weekend. I made an include file to send and retrieve files via ftp.

For reading binary data, see my reading nvault files thread in code snippets and tuts section.
__________________
Bugsy is offline
tripc
Senior Member
Join Date: Aug 2006
Old 11-05-2010 , 15:42   Re: Read Binary File
Reply With Quote #3

I'm patient..
In the meantime I just try to do it myself.

Thanks again.
tripc is offline
tripc
Senior Member
Join Date: Aug 2006
Old 11-06-2010 , 16:17   Re: Read Binary File
Reply With Quote #4

I tried use fread_raw
but for some reason its delete all the spaces in the file

why is that?
tripc is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode