473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Reading Binay files in Mac


Hi

How to read binary files in MAC OS?

FILE *readFile = fopen("filename", "rb");

then reading it like this:

count=fread(readBuffer, sizeof(char), bufferSize, readFile)

This works in windows for all type of files. But in Mac os fread fails
to read from application (.app) and plugins etc. However it succeeds
in reading zip files. [even zip file of a application]

Is it failing becoz in Mac os application are like folders or is there
any other reson?

Oct 26 '07 #1
2 2214
Jim
On 2007-10-26, do*************@gmail.com <do*************@gmail.comwrote:
count=fread(readBuffer, sizeof(char), bufferSize, readFile)

This works in windows for all type of files. But in Mac os fread fails
to read from application (.app) and plugins etc. However it succeeds
in reading zip files. [even zip file of a application]

Is it failing becoz in Mac os application are like folders or is there
any other reson?
MacOS .app files arn't like folders - they *are* folders.

You might be better asking here: comp.sys.mac.programmer.help

Jim
--
http://www.ursaMinorBeta.co.uk
PELUTHO (n.)
A South American ball game. The balls are whacked against a brick wall with
a stout wooden bat until the prisoner confesses.
Oct 26 '07 #2
Jim <ji*@magrathea.plus.comwrites:
On 2007-10-26, do*************@gmail.com <do*************@gmail.comwrote:
>count=fread(readBuffer, sizeof(char), bufferSize, readFile)
This works in windows for all type of files. But in Mac os fread fails
to read from application (.app) and plugins etc. However it succeeds
in reading zip files. [even zip file of a application]

Is it failing becoz in Mac os application are like folders or is there
any other reson?

MacOS .app files arn't like folders - they *are* folders.

You might be better asking here: comp.sys.mac.programmer.help
And when you do, you should tell them *how* it fails.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Oct 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Olivier Maurice | last post by:
Hi all, I suppose some of you know the program Redmon (type redmon in google, first result). This neat little tool allows to hook up any functionality to a printer by putting the file printed...
19
by: Lionel B | last post by:
Greetings, I need to read (unformatted text) from stdin up to EOF into a char buffer; of course I cannot allocate my buffer until I know how much text is available, and I do not know how much...
1
by: Magnus | last post by:
allrite folks, got some questions here... 1) LAY-OUT OF REPORTS How is it possible to fundamentaly change the lay-out/form of a report in access? I dont really know it that "difficult", but...
6
by: Rajorshi Biswas | last post by:
Hi folks, Suppose I have a large (1 GB) text file which I want to read in reverse. The number of characters I want to read at a time is insignificant. I'm confused as to how best to do it. Upon...
2
by: nnimod | last post by:
Hi. I'm having trouble reading some unicode files. Basically, I have to parse certain files. Some of those files are being input in Japanese, Chinese etc. The easiest way, I figured, to distinguish...
7
by: jccorreu | last post by:
I've got to read info from multiple files that will be given to me. I know the format and what the data is. The thing is each time we run the program we may be using a differnt number of files,...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
5
blazedaces
by: blazedaces | last post by:
Ok, so you know my problem, java is running out of memory reading with SAX, the event-based xml parser intended more-so than DOM for extremely large files. I'll try to explain what I've been doing...
6
by: sapsi | last post by:
Hello, I am using HadoopStreaming using a BinaryInputStream. What this basically does is send a stream of bytes ( the java type is : private byte bytes) to my python program. I have done a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.