File Date errors

Greetings,

I am trying to process some files on a debian machine and it seems that if i use those

fileRow.Column("CreationDate").DateTimeValue = file.CreationDateTime
fileRow.Column("ModificationDate").DateTimeValue = file.ModificationDateTime

i get for few documents only the creation date and the modification date , but most of them came empty.

Now if i do a query i have 148768 files and 132965 of them came empty.

Is there a bug in this or there is something else ?

Thanks

Debian 12
XOJO 2024R3.1
Console App

can you look what really exists in this file (without date at xojo) via stat command?

Hello, well on linux using stat i get " > Size: 21444 Blocks: 48 IO Block: 131072 regular file

Device: 0,48 Inode: 15312374 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 1026/ UNKNOWN) Gid: ( 100/ users)
Access: 2024-11-11 12:56:37.560192905 +0200
Modify: 2024-10-25 22:36:11.000000000 +0300
Change: 2024-10-30 06:32:10.163132283 +0200
Birth: -
" while on the code to get the timestamp i get nothing , my db is empty at that file on CreationDate and ModificationDate. It seems that those files came from a Windows machine and when they zip them the files lost all the timestamp part as it got as timestamp the unzip date which in this case is Modify , which is bad for me , but still nothing from XOJO side ,and this is not the first time it happens. and i do check for file existence and it finds it

1 Like

What do you mean by “nothing from XOJO side” ??

hello Tim, i guess you will find the answer in the first post, it means that in the database i get empty string instead of an actual date

What values do file.CreationDateTime and file.ModificationDateTime have? Are they Nil? or do they point to a DateTime? If the latter, what are the values in teh DateTime object?

Coming back to this as apparently it is a big headache, and I just did a test with latest public XOJO.

I just did a simple app to scan the files and save the path and the CreationDate and ModifiedDate and I get things like the picture, and you can clearly see that it is wrong .

Code is simple .

Var fName As String
Var fPath As String

If file <> Nil And file.Exists Then
  fName = file.Name
  fPath = file.NativePath
  
  If mIsConnected Then
    Var row As New DatabaseRow
    
    row.Column("fileName").StringValue = fName
    row.Column("filePath").StringValue = fPath
    row.Column("createdDate").DateTimeValue = file.CreationDateTime
    row.Column("modifiedDate").DateTimeValue = file.ModificationDateTime
    
    Try
      db.AddRow("files", row)
      
    Catch e As DatabaseException
      mIsConnected = False
      stdout.WriteLine("Error : " + e.Message)
      Return
      
    End Try
    
  End If
End If

Which clearly shows that the proper date should be reverse. You cannot have a creation Date Prior to the Modified date.

Can Someone from @Xojo have a look on this as I created cases in the past and still not fixed until now.

Thanks

I think I saw that on Windows too (my .sqlite db file), so in the code, I used a Target iF if and reverse it on Windows.

No, no Issue report #.

The SQL DateTime format is: YYYY-MM-DD HH:MM:SS for anyone wondering.
Looks like the modified date is before the created date and that would make no sense.

Make a bug report asap.

Did you see this in the doc for folderitem.creationdate?

Also, the CreationDateTime may not be accurate as many Linux file systems do NOT actually track the creation date.