• 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
Re: Accessing 8-bit bytes from a file using Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing 8-bit bytes from a file using Cocoa


  • Subject: Re: Accessing 8-bit bytes from a file using Cocoa
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 1 May 2006 15:44:53 +0200

Phil,

On 1.5.2006, at 14:17, Phil Faber wrote:

At the moment, I'm using C coding:

(fread(&oneByte,1,1,fp1)   [where oneByte is defined as a 'char']

..to read in each byte but:

(a) this only works for basic ASCII characters (for example, "A" appears as ASCII 65) but not non-standard characters (for example, "å" appears as ASCII -116 ... yes, MINUS 116)

Nope, it works quite well with any value. That's no Cocoa, but plain C. Read on the signed/unsigned distinction :)


(b) I suspect that it is better to achieve this task with Cocoa instead of C.

That I do concur with.

Can anyone please provide me with the most basic coding to achieve this in Cocoa?

I have already. See NSFileHandle. --- Ondra Čada OCSoftware: email@hidden http://www.ocs.cz private email@hidden http://www.ocs.cz/oc


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Accessing 8-bit bytes from a file using Cocoa (From: Phil Faber <email@hidden>)

  • Prev by Date: Re: NSString into *arguments[]
  • Next by Date: Re: [CocoaProgrammingForAbsoluteBeginners] Accessing 8-bit bytes from a file using Cocoa
  • Previous by thread: Re: Accessing 8-bit bytes from a file using Cocoa
  • Next by thread: Re: Accessing 8-bit bytes from a file using Cocoa
  • Index(es):
    • Date
    • Thread