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:
Adam Fedor 1998-04-15 13:58:47 +00:00
parent d48fdafcbb
commit 5a24da94b6
4 changed files with 28 additions and 6 deletions

View file

@ -1,3 +1,10 @@
Wed Apr 15 09:54:25 1998 Adam Fedor <fedor@doc.com>
* src/NSFIleManager.m ([NSFileManager
-fileAttributesAtPath:traverseLink:]): Add NSFileOwnerAccountName.
* src/externs.m: Add NSFileOwnerAccountName definition.
(patch provided by Marcus Mueller <znek@object-factory.com>)
Sun Apr 5 20:07:28 1998 Scott Christley <scottc@net-community.com>
* Utilize documentation rules in Makefile Package.

View file

@ -138,6 +138,7 @@
extern NSString* NSFileSize;
extern NSString* NSFileModificationDate;
extern NSString* NSFileOwnerAccountNumber;
extern NSString* NSFileOwnerAccountName;
extern NSString* NSFileGroupOwnerAccountNumber;
extern NSString* NSFileReferenceCount;
extern NSString* NSFileIdentifier;

View file

@ -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];
}

View file

@ -90,6 +90,7 @@ NSString* StreamException = @"StreamException";
NSString* NSFileSize = @"NSFileSize";
NSString* NSFileModificationDate = @"NSFileModificationDate";
NSString* NSFileOwnerAccountNumber = @"NSFileOwnerAccountNumber";
NSString* NSFileOwnerAccountName = @"NSFileOwnerAccountName";
NSString* NSFileGroupOwnerAccountNumber = @"NSFileGroupOwnerAccountNumber";
NSString* NSFileReferenceCount = @"NSFileReferenceCount";
NSString* NSFileIdentifier = @"NSFileIdentifier";