CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    1

    Question how to check file modification time?

    I want to watch a file which it will be modified by another application,if this file has been modified then i'll open the file and read it.
    i coudln't find any existed code on the internet to solve this problem,so i tried by myself,but i couldn't find the function that can read the date/time stamp of the file.
    if you have any idea about preprogrammed code or about the function that check the date/time of the file please answer me as soon as possible.
    thank you in advance.
    Yaser...

  2. #2
    Join Date
    May 2000
    Location
    Phoenix, AZ [USA]
    Posts
    1,347
    This isn't something that C++ covers by itself. So, you'll have to
    use some operating system dependent method. Here's a link
    which could be helpful to you if you're on Windows machines:
    http://msdn.microsoft.com/library/de...onbyhandle.asp

    If you're on a unix machine, sadly, I don't know the answer.

    --Paul

  3. #3
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,020
    You can use stat on the filename on startup and run stat on it at specified intervals. The information returned by stat will give you the modification date/time. If you are using Windows, stat is called _stat.
    Succinct is verbose for terse

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured