NSFileManager contentsEqualAtPath
NSFileManager contentsEqualAtPath
- Subject: NSFileManager contentsEqualAtPath
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Mon, 14 Aug 2006 22:57:39 +0200
Computer A has mounted via Finder some home directory of computer B.
A program does on A:
NSFileManager *fileManager = [ NSFileManager defaultManager ] ;
NSString *localPath = @"/Users/userid/Desktop/Test1/a"; <-- on
computer A
NSString *distantPath = @"/Volumes/userid/Desktop/Test1/b"; <-- on
computer B
BOOL ok = [ fileManager copyPath: localPath toPath: distantPath
handler: nil ];
// ok
Then the user deletes the last line (2 bytes + \n) of file b on
computer B .
Now the program does on A:
BOOL same = [ fileManager contentsEqualAtPath: distantPath andPath:
localPath ];
// same <-- strange
but the other way round:
BOOL sam2 = [ fileManager contentsEqualAtPath: localPath andPath:
distantPath ];
// not same <-- strange
the user does on computer A:
ls -l /Users/userid/Desktop/Test1/a --> 53 bytes
ls -l /Volumes/userid/Desktop/Test1/b --> 53 bytes <-- strange
the user does on computer B:
ls -l /Users/userid/Desktop/Test1/b --> 50 bytes
the user opens distantPath on computer A in a hex editor and sees 50
bytes as expected, followed by 3 zero bytes.
What is my program doing wrong that it gets such strange and
unexpected results?
(both computers 10.4.7 ppc)
Gerriet.
_______________________________________________
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