• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
/ NSFileHandle in rtf and mpg files /
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

/ 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.


  • Follow-Ups:
    • Re: / NSFileHandle in rtf and mpg files /
      • From: Clark Cox <email@hidden>
    • Re: / NSFileHandle in rtf and mpg files /
      • From: "Louis C. Sacha" <email@hidden>
  • Prev by Date: Re: Java or C++ for cross-platform Cocoa/.NET?
  • Next by Date: Re: Rasterizing an NSString to a bitmap
  • Previous by thread: Re: Mail Plug-ins?
  • Next by thread: Re: / NSFileHandle in rtf and mpg files /
  • Index(es):
    • Date
    • Thread