Silverfrost Forums

Welcome to our forums

FILES@ and DOS compressed format.

23 Jun 2011 12:50 #8456

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?

24 Jun 2011 12:14 #8457

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 ?

      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
24 Jun 2011 9:31 #8458

Hi John, wow! How or where did you find that? BR Johannes

29 Jun 2011 4:38 #8483

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

Please login to reply.