ファイルの作成日(変更日ではない)を見つけようとしています。
変更日はありますが、作成日はファイルの属性に含まれていないようです。
私はこのコードを使用しています。
NSFileManager* fm = [NSFileManager defaultManager];
NSString* path = [PathHelpers pathInDocumentsFolderWithFilename:FILE_NAME];
NSDictionary* attrs = [fm attributesOfItemAtPath:path error:nil];
if (attrs != nil) {
return (NSDate*)[attrs objectForKey: NSFileCreationDate];
} else {
return nil;
}
これは常にnilを返します。デバッガーに「poattrs」と入力して、NSDictionaryのキーと値のペアのリストを取得すると、次のようになります。
NSFileGroupOwnerAccountID = 20;
NSFileGroupOwnerAccountName=スタッフ;
NSFileModificationDate = 2010-01-21 11:47:55 +0000;
NSFileOwnerAccountID = 501;
NSFileOwnerAccountName = ben;
NSFilePosixPermissions = 420;
NSFileReferenceCount = 1;
NSFileSize = 338;
NSFileSystemFileNumber = 2234;
NSFileSystemNumber = 42553324;
NSFileType = NSFileTypeRegular;
作成日なし..bah..
作成日を取得する別の方法を知っている人はいますか、それともiOSには存在しませんか?