Any chance to get the file creation/modification date?

agraham

Expert
Licensed User
Longtime User
Have a play with this. See if it does what you need?

EDIT :- the dates and times are a string. In case it is not obvious get the ticks value by :-
B4X:
  Dim dt(2) ' in globals

  ...

  DateFormat = "dd/mm/yyyy" ' for those of us for whom the defaults fail
  TimeFormat = "hh:mm:ss"
  dt() = StrSplit(info(4)," ")
  d = DateParse(dt(0)) + TimeParse(dt(1)) Mod cTicksperday
  '  "mod" because the current date is included by TimeParse
 

Attachments

  • FilesEx1.0.zip
    2.2 KB · Views: 209
Last edited:
I just tried to read the file info of the program that is running to have an auto version number by this.
But i always get an unsupported error-message.

Is there no chance to read the file info of the program that uses this .dll?

It would be great if this would be possible.


Sub Globals
Dim info(5)
End Sub

Sub App_Start
Form1.Show
FilesEx1.New1
info() = FilesEx1.FileInfo("DateTest.exe")
Label1.Text = "Version " & SubString(info(2),6,4)-2007 &"."& Int(SubString(info(2),3,2))&"."& Int(SubString(info(2),0,2))
End Sub


The program is called DateTest.exe, so it has to read its own info.
 
Last edited:

agraham

Expert
Licensed User
Longtime User
Is there no chance to read the file info of the program that uses this .dll?
There is no problem in doing this.

If it is not finding the file try

info() = FilesEx1.FileInfo(AppPath & "\DateTest.exe")

If that still doesn't work check the actual strings returned with a msgbox() before trying to build your version string to check the formatting. The strings may be differently formatted between device and desktop.
 
Top