Getting Time Stamp
Posted
#1
(In Topic #2029)
Regular

How to get a files time stamp
How do you get the time stamp of a file that was copied to another drive to verify the file was updated on the drive it was copied to? For example I copy a file from my home drive to a USB stick. I want to display the time stamp of the file on the USB stick to insure the the file was updated. Thanks in advance.
Posted
Administrator



Have a look at the stat function : https://gambaswiki.org/wiki/lang/statcage said
How do you get the time stamp of a file
From “Getting Time Stamp”, January 25th 2026, 12:32 PM
And some more on Stat here: https://gambaswiki.org/wiki/comp/gb/stat
That should get you there, if not let us know..
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Regular

Posted
Administrator



cage said
Thank you sir that works like a charm. One problem is now I get a complition error when I try to make an executable
From “Post #13,908”, January 25th 2026, 3:28 PM
Do you mean that an 'Compile All' in IDE and running the application from IDE works. But,when creating an executable it won't compile, and so no executable is made?
You think Stat is causing this? If so, what happens if you comment that line and make an executable, does that work?
If not, Stat is not the cause and without any more info I'm lost in what could cause this.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Regular

Posted
Administrator



So, all works, it's just warnings, no errors. Is that what you mean?cage said
Program works no problem just get the compiliation warrning when I compile it. I think that mybe it may be just a bug in gambas. I did try using stat three differn ways but it always stat compilied with that warning. Really want to thank you for you help in this matter. By the way I am using version 3.21.2 so I don't know if it is the same on the older versions or not.
From “Post #13,910”, January 25th 2026, 6:40 PM
And what exact warnings to you get, that might shed a light on the matter as these warnings might come from outside Gambas.
Jjust like you often see when using the toolkits (gtk or qt) you sometimes see gtk or qt warnings in console, that come from underlying mechanisms that Gambas interfaces with.
The gambas version shouldn't make any difference IMHO.
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Regular

Normally when I get that error there was something I forgot to remove from the code but in this instance there is nothing in the code that's not suppose to be there.
This the part of the code that is causing the problems but I am using QT5 not GTK.
Message.Title = "File Status"
Message.Info("<b>MODIFIED DATE: " & Stat(tbDest.Text &/ filename).LastModified)
Posted
Enthusiast


it doesn't happen here:
Code
Public Sub Form_Open()
Dim sPath As String = User.Home &/ "A.html" ' <--- There is a file with this name in my home folder
Message.Title = "File Status"
If Exist(sPath) Then Message.Info("<b>MODIFIED DATE: " & Stat(sPath).LastModified)
Me.Close
End
Posted
Regular

Posted
Regular

Posted
Expert


When you select Project > Compile All from the Gambas GUI main menu, the compiler will halt if it finds a serious error and highlight the code.
'Non-serious' warnings are for programming errors / oversites where you may have for example:
- Declared a variable but it is not used in code.
- You have overwritten a previously declared global variable. ( Private Wiget as string - then later in a subroutine , Dim Wiget as string)
- You have a subroutine or function that appears in your code but is never used.

If you double-click on the 'Warnings' tab you will get this.

If you then 'double-click on a specific line, the editor should open that block of code and highlight the variable in question.
Fix as required.
The examples above come from a Games (multiple) that I'm redesigning, hence so many compiler errors
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Regular

1 guest and 0 members have just viewed this.

