mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Add a few OSX compatibility methods
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33929 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
377a757e54
commit
cbf54ac301
8 changed files with 111 additions and 27 deletions
|
@ -10,8 +10,12 @@ int main()
|
|||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||
NSString *dir = @"NSFileManagerTestDir";
|
||||
NSString *dirInDir = [@"TestDirectory" stringByAppendingPathComponent: @"WithinDirectory"];
|
||||
NSString *dirInDir;
|
||||
NSString *str1,*str2;
|
||||
|
||||
dirInDir
|
||||
= [@"TestDirectory" stringByAppendingPathComponent: @"WithinDirectory"];
|
||||
|
||||
PASS(mgr != nil && [mgr isKindOfClass: [NSFileManager class]],
|
||||
"NSFileManager understands +defaultManager");
|
||||
|
||||
|
@ -63,6 +67,14 @@ NSLog(@"'%@', '%@'", NSUserName(), [attr fileOwnerAccountName]);
|
|||
"NSFileManager creates a file");
|
||||
PASS([mgr fileExistsAtPath: @"NSFMFile"],"-fileExistsAtPath: agrees");
|
||||
|
||||
{
|
||||
NSArray *a;
|
||||
|
||||
a = [mgr contentsOfDirectoryAtPath: @"." error: 0];
|
||||
PASS(1 == [a count] && [[a lastObject] isEqual: @"NSFMFile"],
|
||||
"-contentsOfDirectoryAtPath: agrees");
|
||||
}
|
||||
|
||||
{
|
||||
NSData *dat1 = [mgr contentsAtPath: @"NSFMFile"];
|
||||
str2 = [[NSString alloc] initWithData: dat1 encoding: 1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue