• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Need File information
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need File information


  • Subject: Re: Need File information
  • From: Quinn <email@hidden>
  • Date: Sun, 14 Jun 2009 15:11:20 -0700

At 13:09 +0530 5/6/09, Poonam wrote:
Need to extract the File modification date of the files that I am opening in my application.

For the same, I use the following code snippet:

FSCatalogInfo catInfo;
OSErr err = FSGetCatalogInfo (&fsRef, kFSCatInfoContentMod, &catInfo, NULL, NULL, NULL);


if (noErr == err)
{
    UTCDateTime dateTime = catInfo.contentModDate;
    LocalDateTime ldt;
    ConvertUTCToLocalDateTime(&dateTime, &ldt);
}

The date/time (in ldt) which I get here has a huge difference (in months), with what I see when I do Get Info of the file in the Finder.

As it stands, I can't see anything wrong with the above code. However, you're really only showing half the story here. Specifically, you don't show how you convert ldt to a string (or whatever date representation you're using). The error might be there.


My suggestion: run FSMegaInfo against the file and see what it displays. It should agree with the Finder's result. If it does, then you have a bug in your code and you can compare it to the FSMegaInfo source to see what's going wrong. OTOH, if FSMegaInfo also shows the wrong results, well, I'm confused (-:

<http://developer.apple.com/samplecode/FSMegaInfo/index.html>

The folowing is an example of how to use FSMegaInfo to get this value:

$ FSMegaInfo FSGetCatalogInfo -kFSCatInfoContentMod /mach_kernel
name    = 'mach_kernel'
catalogInfo:
    contentModDate   = 0.3321410102.0 (Tuesday, 31 March 2009 22:55:02 PDT)

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Need File information (From: Poonam <email@hidden>)

  • Prev by Date: Re: How to mount a range of block on a disk as a partition
  • Next by Date: Re: How to mount a range of block on a disk as a partition
  • Previous by thread: Need File information
  • Next by thread: How to mount a range of block on a disk as a partition
  • Index(es):
    • Date
    • Thread