How to get Date and Time of files in Flash
cmatkin
Posts: 86
Hi,
I was wondering if it is possible to find the date and time of a file that I have created in flash.
I save configuration information into a file. This can be edited via FTP. This all works.
I need a way for my program to know when the file date and time changes in order to update my code with the new configuration information.
Would any one know of a way?
Regards
Craig
I was wondering if it is possible to find the date and time of a file that I have created in flash.
I save configuration information into a file. This can be edited via FTP. This all works.
I need a way for my program to know when the file date and time changes in order to update my code with the new configuration information.
Would any one know of a way?
Regards
Craig
0
Comments
One possible workaround is to have the person who is editing the config file also drop another file (maybe something like reread.txt ? it doesn?t matter what?s in the file) in the same directory as a flag to indicate the config file needs to be re-read. Then your program can periodically do a FILE_DIR to see if the reread flag file exists and if it does your program can re-read the config file and then delete the reread flag file.
thanks for that. I thought the same. It is not a nice solution though.
The other solution that i thought of was sequence numbers.
EG:
every few seconds read a number from the bottom of the file.
compare it to the sequence number stored in ram, if they are the same add 1 to the one in ram and update the one on the file.
If the numbers are not the same then load the file and reset the numbers.
My thought that is some one was editing the file the sequence number would get out of sync.
Regards
Craig
Yeah, that?s even worse then the first idea. All you need is a binary flag. No need to count anything and complicate matters. All you need is yes or no.
I like the "Telnet into myself" approach as well, but I think this one might cut some overhead and might be easier to implement?
- Chip
I'm pulling this from my fractured memory...
but won't the LIST (pathway)(filename) command just return info (including mod date) of a file?
I pulled the function that uses that time date stamp command out of the module and it's actually "MDTM" not what I said previously.
link to commands:
http://www.nsftools.com/tips/MSFTP.htm
June 7 2006
with no time listed, and others will display as:
June 25 09:50
with no year listed.
However, if I use FTPSurfer (a freeware program I picked up somewhere) or Internet Explorer, it shows the file and directory names. If I right-click and select properties, it shows the complete date and time.
The way I handle this, is to just put a button on the Touchpanel on my setup page that reloads the config info. Then teach the users if they change the config file they have to go press the button to actually load the info.