mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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,31 +10,32 @@ copyright 2004 Alexander Malmberg <alexander@malmberg.org>
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSFileManager *fm=[NSFileManager defaultManager];
|
||||
NSArray *files;
|
||||
int i;
|
||||
BOOL e,d;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
NSArray *files;
|
||||
int i;
|
||||
BOOL e, d;
|
||||
|
||||
files=[fm directoryContentsAtPath: @"."];
|
||||
printf("%lu files\n", (unsigned long)[files count]);
|
||||
for (i=0;i<[files count];i++)
|
||||
{
|
||||
int j;
|
||||
NSString *f=[files objectAtIndex: i];
|
||||
e=[fm fileExistsAtPath: f
|
||||
isDirectory: &d];
|
||||
printf("%5i: %i %i %s\n",i,e,d, [f lossyCString]);
|
||||
for (j=0;j<[f length];j++)
|
||||
printf(" %3i: %04x\n",j,[f characterAtIndex: j]);
|
||||
}
|
||||
files = [fm directoryContentsAtPath: @"."];
|
||||
printf("%lu files\n", (unsigned long)[files count]);
|
||||
for (i = 0; i < [files count]; i++)
|
||||
{
|
||||
int j;
|
||||
NSString *f = [files objectAtIndex: i];
|
||||
|
||||
/* const char *test="hallå.txt";
|
||||
NSString *s=[NSString stringWithCString: test];
|
||||
printf("s=%s\n", [s lossyCString]);*/
|
||||
e = [fm fileExistsAtPath: f
|
||||
isDirectory: &d];
|
||||
printf("%5i: %i %i %s\n",i,e,d, [f lossyCString]);
|
||||
for (j = 0; j < [f length]; j++)
|
||||
printf(" %3i: %04x\n",j,[f characterAtIndex: j]);
|
||||
}
|
||||
|
||||
[arp release]; arp = nil;
|
||||
/* const char *test="hallå.txt";
|
||||
NSString *s=[NSString stringWithCString: test];
|
||||
printf("s=%s\n", [s lossyCString]);*/
|
||||
|
||||
return 0;
|
||||
[arp release]; arp = nil;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue