Re: Low-level File Access
Re: Low-level File Access
- Subject: Re: Low-level File Access
- From: Andrew Pinski <email@hidden>
- Date: Sat, 16 Mar 2002 22:49:31 -0500
I would just use the ANSI (ISO) C functions (from stdio.h) for random
access on a file.
Thanks,
Andrew Pinski
On Saturday, March 16, 2002, at 10:34 , Nick wrote:
Hello all.
I'm currently working on a project for my computer science class that
requires that I implement random or direct file access. Although I've
read lots of the documentation (NSFileHandle, NSData, NSArchiver, et
al.), I'm still a little unsure on a few issues and would sincerely
appreciate the confirmation of this distinguished list before I put
this into code.
First of all, how does ObjC respond if the path given for the filename
does not currently exist? In class, I've learned that C++ will
automatically create a file if it isn't there, is this the same in
Objective C? Finally, what path do I use to create a file inside the
package of my application? Is this a good idea?
I am planning on storing binary trees (of my own design) in the file.
Each binary tree will have a set number of nodes in it at any given
time, although the values in each node may change. Will these trees
therefore be of constant size? Or will they change with different
values in the nodes? If I find the length of one of these trees and
then (with all the trees placed consecutively) multiply it by the
position of the tree I want to find (say 3 for the fourth tree), will
that correctly find the start of the bytes of the tree? (This is the
method I used in C++, just wondering if all this works the same way)
Finally, will the support for object graphs take care of the pointers
existent in binary trees? Are object graphs (specifically my binary
tree) decoded in a special way or will unarchiveObjectWithData: suffice?
My apologies for bothering the list if this is all too simple stuff,
but please bear with me, as I am still learning.
On a side note, can Cocoa programs be recompiled easily to run in
NeXT? What about other platforms (Linux (GNU), for example)? Just
curious.
Sincerely,
Nick
email@hidden
_______________________________________________
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.