RTTSoftware Support Forum

PDF Explorer => General => Topic started by: Padanges on August 19, 2016, 11:05:09 AM

Title: Question about the Date Parameter
Post by: Padanges on August 19, 2016, 11:05:09 AM
Hi,
in Eval expressions "CD" stands for Creation date, "MD" stands for Modification date, and "FD" stands for File date, but what exactly is the file date? Is it file access date? Is it file DB entry creation date? I need to have a separate entry for: file last Access Date, file DB Entry Creation Date, and file DB Entry Modification (for example, after Info Field edit) Date. Is there a way to get any of those parameters?


Thanks in advance
Title: Re: Question about the Date Parameter
Post by: RTT on August 20, 2016, 02:56:39 AM
The PDFE file date field holds the file system file date modified property. The creation date and modification date fields are related to the PDFs internal metadata  properties.
Title: Re: Question about the Date Parameter
Post by: Padanges on August 22, 2016, 12:43:31 PM
Is there a way to get file last Access Date, file DB (PDFe Entry) Creation Date, and file DB (PDFe Entry) Modification Date?
Title: Re: Question about the Date Parameter
Post by: RTT on August 23, 2016, 02:35:36 AM
The modification date is already indexed in the DB (due to a bug in latest release, it is showing in GMT instead of local time), as it is used internally to know if the file needs to be reindexed.
The last accessed and creation dates are not currently indexed in the DB, and will not be until major DB code changes introduced. But these are file system properties, so, as workaround, you can use a script to fill custom fields with these.
Title: Re: Question about the Date Parameter
Post by: Padanges on August 23, 2016, 06:53:28 AM
Ok, then the file last Access Date should be something like this "return BatchFile.DateLastAccessed;" for the script, but it is not. Nor I was able to find any other expressions among sample scripts. Could you help with this?
Title: Re: Question about the Date Parameter
Post by: RTT on August 24, 2016, 12:10:55 AM
Check the DateLastAccessed property of the FileSystemObject (https://msdn.microsoft.com/en-us/library/c8xh895w(v=vs.84).aspx)

Code: [Select]
function DateLastAccessed() {
    var fso, f;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    f = fso.GetFile(BatchFile.Filename);
    return f.DateLastModified;
}
Title: Re: Question about the Date Parameter
Post by: Padanges on August 25, 2016, 11:36:56 AM
Thanks. The code works fine. Though, operating systems handle time stamping differently depending on the file system in use, therefore it's tricky to "audit" Access Date properly.
Title: Re: Question about the Date Parameter
Post by: RTT on August 26, 2016, 01:45:53 AM
If you know the file system, you may take these differences into account.
https://msdn.microsoft.com/en-us/library/ch28h2s7(v=VS.85).aspx