Very strange problem. I've been testing my little command line program which reads a file and parses through it and it is working fine with my test data but when I went after the real thing it couldn't find the file.
The original file was a text file put together by text edit and the actual file was saved from Microsoft Word in MS-Dos format. When I tried to read the MS Word file, it couldn't find it. I did not get an error but did get a nil string back from the file loading method. I then renamed my test file to the same name and it got the original test data. Huh? At worst, I figured I'd see some sort of odd looking data loaded into my string... not nil.
Here is a stylized portion of code snippet. Please ignore the 'catch and release' code around the Datafile NSString... I realize I don't need to do it in that way and that is not the point of the question.
datafilename is set to 'config1.txt'.
(NSString*) OpenEntryFile: (NSString*) pathname withdatafilename: (NSString*) datafilename {
NSStringEncoding encoding;
NSError* error = nil;
NSString* inputdatafile;
NSString* response;
NSString *homeDir = NSHomeDirectory();
NSString *fullPath = [homeDir stringByAppendingPathComponent:datafilename];
filepointer = 0;
[Datafile release];
inputdatafile = [NSString stringWithContentsOfFile: fullPath usedEncoding:&encoding error:&error];
Datafile = [inputdatafile copy];
response = [NSMutableString stringWithString: @"OK"];
if (error) {response = [NSMutableString stringWithString: @"ERROR"];};
if ([Datafile length] < 60) {response = [NSMutableString stringWithString: @"SHORT"];};
return response;
}