mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 20:26:42 +00:00
Add more keys to fileAttributes dict.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2788 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d48fdafcbb
commit
5a24da94b6
4 changed files with 28 additions and 6 deletions
|
@ -600,10 +600,12 @@ static NSFileManager* defaultManager = nil;
|
|||
{
|
||||
struct stat statbuf;
|
||||
const char* cpath = [self fileSystemRepresentationWithPath:path];
|
||||
struct passwd *pw;
|
||||
int mode;
|
||||
|
||||
id values[9];
|
||||
id keys[9] = {
|
||||
int count = 10;
|
||||
|
||||
id values[10];
|
||||
id keys[10] = {
|
||||
NSFileSize,
|
||||
NSFileModificationDate,
|
||||
NSFileOwnerAccountNumber,
|
||||
|
@ -612,7 +614,8 @@ static NSFileManager* defaultManager = nil;
|
|||
NSFileIdentifier,
|
||||
NSFileDeviceIdentifier,
|
||||
NSFilePosixPermissions,
|
||||
NSFileType
|
||||
NSFileType,
|
||||
NSFileOwnerAccountName
|
||||
};
|
||||
|
||||
if (stat(cpath, &statbuf) != 0)
|
||||
|
@ -649,9 +652,19 @@ static NSFileManager* defaultManager = nil;
|
|||
#endif
|
||||
else
|
||||
values[8] = NSFileTypeUnknown;
|
||||
|
||||
|
||||
pw = getpwuid(statbuf.st_uid);
|
||||
|
||||
if(pw)
|
||||
{
|
||||
values[9] = [NSString stringWithCString:pw->pw_name];
|
||||
}
|
||||
else
|
||||
{
|
||||
count = 9;
|
||||
}
|
||||
return [[[NSDictionary alloc]
|
||||
initWithObjects:values forKeys:keys count:5]
|
||||
initWithObjects:values forKeys:keys count:count]
|
||||
autorelease];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue