Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    File time and size

    SDK Help
    0
    4
    717
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 23/05/2018 at 23:49, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R19 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hi,

      I am using BrowseFiles to iterate over the files in a directory and get each file's creation / modification time as well as the file's size in order to built up some kind of caching.

      Later on, when I am -from within the plugin- writing (or reading) a file from that directory I want to update the cache. But to obtain the file's time and size I need to create a BrowseFiles, initialize it with the directory, and scan the whole directory until I reach the file with the filename I just saved, in order to use the GetFileTime() and GetSize().

      I did find that BaseFile provides a GetLength() method, but I am missing the most important one, which is to get the file's modification time. Is there any other solution besides using BrowseFiles?

      Just to complete the background information: FileMonitor is of no use to me in this project, since the caching is meant to be used over different sessions of Cinema 4D. I also don't need to remain in sync in real-time. Only need to sync when accessing a file which is potentially updated, which is why I prefer to use the scenario of checking the file's modification time.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 24/05/2018 at 06:54, xxxxxxxx wrote:

        Hi,

        LocalFileTime in combination with GeGetFileTime() is what you are looking for (LocalFileTime manual).

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 24/05/2018 at 07:11, xxxxxxxx wrote:

          Thanks Andreas,

          And I thought I had read all there was to read.

          Apologies for not reading the LocalFileTime manual in more details.
          It would have avoided the question in the first place. Sorry!

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 24/05/2018 at 07:32, xxxxxxxx wrote:

            No worries. To be totally honest, although I had written these manuals, Sebastian had to remind me of these functions... 😉

            1 Reply Last reply Reply Quote 0
            • First post
              Last post