Tasp
Full Member
Posts: 215
|
Post by Tasp on Jan 1, 2021 9:48:03 GMT -5
This seems like an awful lot of code just to get the file info. This only seems to draw in the modified date rather than the created date.
r = filedate("test.txt", filedate$)
print filedate$
END
FUNCTION filedate(filename$,BYREF filedate$) dim info$(0, 0) files DefaultDir$, info$() qtyfiles = VAL(info$(0,0)) FOR a = 0 TO qtyfiles IF info$(a,0) = filename$ THEN filedate$ = info$(a,2) EXIT FOR END IF NEXT END FUNCTION
|
|
|
Post by Rod on Jan 1, 2021 11:17:00 GMT -5
You could put the year, month,day,hour and minute as part of the file name.
|
|
Tasp
Full Member
Posts: 215
|
Post by Tasp on Jan 1, 2021 11:54:59 GMT -5
On this occasion this file holds a numeric value if the EULA has been accepted, 0 for false and 1 for true. So this will be a very crude attempt at "signing" the file.
When the user accepts the agreement a different file is changed to hold a 1, by checking the date stamp on this file it will display the date the EULA is accepted elsewhere on screen.
I'm aware there is software out there that will allow changes to the file information, as I say it's just a crude attempt, I don't think it needs any further security checks. It's simply a EULA. But I like checking these things.
This just seems alot of code to do a simple thing.
Obviously I can get rid of the function and just leave the bare bones. But I thought there might be away just to retrieve the file info.
dim info$(0, 0) files DefaultDir$, info$() qtyfiles = VAL(info$(0,0)) FOR a = 0 TO qtyfiles IF info$(a,0) = filename$ THEN filedate$ = info$(a,2) EXIT FOR END IF NEXT
I thought there might be an cheaper way, something like this.
dim info$(0,0) FILES DefaultDir$ + "\test.txt", info$() filedate$ = info$(1,2) print filedate$
|
|