| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Your code basically works for me... Except I'd suggest constructing the
filename to open using [sourcePath stringByAppendingPathComponent:
testFile], and I'd make sure I sent closeFile to the NSFileHandle before
looping/returning otherwise I'd run out of file descriptors.
You should ensure testFile is a file and not a directory as probably won't
be able to open directories that way (POSIX has different calls to open a
directory and to open a file), and you certainly won't be able to lock them
even if you could. (Use NSFileManager -fileExistsAtPath:isDirectory:)
Library calls typically only set errno when they fail, so you should set
errno to 0 yourself to avoid false errors.
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.