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.