 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
johannes
Joined: 21 Jan 2011 Posts: 65 Location: Leimen, Germany
|
Posted: Thu Jun 23, 2011 1:50 pm Post subject: FILES@ and DOS compressed format. |
|
|
FILES@ is returning the date of a file. What does "The date and time are returned in the DOS compressed format" mean? How can I convert either the the compressed format to ddmmyy or can I get the current date in "compressed format".
Example: 16082 means June 18th 2011
Or does a better way exist to inquire the date of any file? |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2615 Location: Sydney
|
Posted: Fri Jun 24, 2011 1:14 am Post subject: |
|
|
It should be documented somewhere. Below is some code that extracts the info. Only this week, I've used FILEINFO@ for the first time and it used a date/time format, which is seconds since 1/1/1970 (which overflows in Jan-2038!). I wonder where all these different formats come from ?
Code: | subroutine get_file_age (dos_date, dos_time, file_age)
!
! subroutine to compute file age for directory entry listing
!
integer*2 dos_date, dos_time
integer*4 file_age, minutes_since_1980
external minutes_since_1980
!
integer*4 dd,mm,yy, hh,mi,ss
intrinsic mod, iand, ishft
!
! use ishft to account for -ve hhmmss
!
! yyyyyyy mmmm ddddd
dd = iand (dos_date,31) ! 0-31
mm = iand (ishft(dos_date,-5),15) ! 0-15
yy = ishft (dos_date,-9) ! 0-127
yy = yy + 1980
!
! hhhhh mmmmmm sssss
ss = iand (dos_time,31)*2 ! 0-31
mi = iand (ishft(dos_time, -5),63) ! 0-63
hh = iand (ishft(dos_time,-11),31) ! 0-31
!
file_age = minutes_since_1980 (yy, mm, dd, hh, mi) + ss/32
return
!
end
|
|
|
Back to top |
|
 |
johannes
Joined: 21 Jan 2011 Posts: 65 Location: Leimen, Germany
|
Posted: Fri Jun 24, 2011 10:31 am Post subject: |
|
|
Hi John,
wow! How or where did you find that?
BR Johannes |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Wed Jun 29, 2011 5:38 pm Post subject: |
|
|
Johannes,
Download the FTN77 subroutine library routines manual from the Documentation section of the FTN95 part of the website. I've said this several times before on these forums - many (in fact all of the routines I've wanted) of the FTN77 routines are still in FTN95 and they do work. Of course, there are lots of things relating to the DBOS DOS-extender, and primitive windowing, that no longer apply. As far as I know, all of the text-mode routines (cursor positioning etc) still also work in DOS command windows.
The details of DOS attributes for files are dealt with in old books on MS DOS, or can be found by Google.
Regards
Eddie |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|