/ NSFileHandle in rtf and mpg files /
/ NSFileHandle in rtf and mpg files /
- Subject: / NSFileHandle in rtf and mpg files /
- From: "TM Systems::Luis Poján" <email@hidden>
- Date: Tue, 8 Jun 2004 12:48:44 -0400
I'm trying to read a rtf file. My code is more or less like this ((I'm
not including parts of the code like obtaining the file from the panel
and editing the path)):
NSString *scriptFile;
NSFileHandle *scriptFileHandle;
NSData *theData;
unsigned char dataBuffer[40];
unsigned long long fileOffset;
unsigned off = 21;
/* I get the file from a panel */
/* I edit the string of the path. I remove the 'file://localhost' part
*/
scriptFileHandle = [NSFileHandle fileHandleForReadingAtPath:
scriptFile];
fileOffset = [scriptFileHandle seekToEndOfFile];
[bDisplay setDoubleValue: fileOffset];
fileOffset -= off;
[scriptFileHandle seekToFileOffset: fileOffset];
theData = [scriptFileHandle readDataOfLength:30];
[theData getBytes: dataBuffer];
When I print what's in fileOffset ((it should return the size of the
file, right?)), it always returns the same misterious number:
2424892184.
I'm also trying to open video files with the same code ((in another
class, of course)). When it's an avi it works perfectly... but when
it's a mpg file it returns the very same strange number. I assume
there's something wrong when I call fileHandleForReadingAtPath. I've
tried with different paths and it won't work either. What's that
number? Sorry if this mail is too long. It's my first...
:::::::::::::::::::::::::::::::::::::::-)
Luis Enrique Pojan
TM Systems, LLC
Caracas, Venezuela
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.