Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Getting File Date

Author
Message
Alfa x
20
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 14th May 2010 22:35
Hi,
I need help with something I looking into but have been unable to retrieve directly. something like GET FILE DATE$(fileName$),
I know there is a possibility to do it with kernel32 functions, but I have been unable to do it.

The way I look forward to retrieve the file date, has to be different from GET FILE DATE$() function, since it has to go through many files because of FIND FIRST or FIND NEXT, and I need that the process is very fast since there can be many files and because of quick calling.

Thank you so much.
Nomad The Great
18
Years of Service
User Offline
Joined: 18th Apr 2008
Location:
Posted: 15th May 2010 05:05
The get file date$() will work with multiple files in the fashion you stated, even the help text says so.

Alfa x
20
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 15th May 2010 05:50
Hi Nomad.
Thanks.

As I said, that command is not useful to me because I have to go over every file to use the file I want. Since speed is a problem, what I really need is function that I can give as a parameter an absolute path and it returns to me the file date as any type (String for example).
Nomad The Great
18
Years of Service
User Offline
Joined: 18th Apr 2008
Location:
Posted: 16th May 2010 05:36 Edited at: 16th May 2010 05:37
hmmm I always thought you could add that parameter

get file date$(filestringname$)

maybe i'm thinking of an older language i used to use, i dunno.
Alfa x
20
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 16th May 2010 21:19
Yes is possible,
but with the kernel32. I was not able, was very difficult for me to use the Kernel32. If someone can help me using it I will be very grateful.
Alfa x
20
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 19th May 2010 14:44
Anyone here?,
maybe IanM?
Alfa x
20
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 31st May 2010 00:41
mmm...
=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 31st May 2010 02:03
I had a look at the MSDN about this problem, and if I'm honest it is much simpler to just use the native DBP commands.

Here is a simple function which returns the time and date of a filename given.

Hope it helps.



Alfa x
20
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 1st Jun 2010 15:40
Hi Prof,
thank you so much for your interest.

when there are many files that way can become slow. Im trying to do a very fast solution to the problem, since speed is critical for it to work right with another things I'm doing.

Since kernel32 literally pulverized me, in this moment Im trying to do a c++ Dll that has a function that returns the last modified date, if you send the file full Path. I will post the results here so everybody knows the answer too.

Cheers.

AlfaX.
Alfa x
20
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 7th Jun 2010 00:54 Edited at: 7th Jun 2010 00:56
Hi all,
I have finished the dll, and want to share it with you all. It has only one function.

The difference with the DBPRO approach is that you only make one call to get the file date with is much faster than having to go file by file.

You can use it like:

hola$ = SDLL_getFileDate("c:\\test2\test.txt")

You can download the dll which I have attached to this post.

Login to post a reply

Server time is: 2026-07-25 10:52:07
Your offset time is: 2026-07-25 10:52:07