Module: _dir      Library: Clipper 5.3


This module contains the following functions and procedures:



Note: Because this is raw decompiler output, the code is closer
to that seen in a .PPO file, rather than a .PRG file. In other
words, you must allow for the preprocessor conversions normally 
performed based on the contents of STD.CH and other .CH files
 
#include "common.ch"
#include "inkey.ch"

//---------------------------------------------------[top]-
//  DBFDIRLINE( Arg1 )
//
static function DBFDIRLINE( Arg1 )

   local Local1, Local2, Local3 := 0, Local4, Local5, Local6, ;
      Local7 := CToD(""), Local8, Local9
   if ( ( Local1 := fopen(Arg1[ 1 ]) ) != -1 )
      Local2 := Replicate(Chr(0), 8)
      if ( fread(Local1, @Local2, 8) == 8 .AND. ( ;
            bin2w(SubStr(Local2, 1, 1)) == 3 .OR. ;
            bin2w(SubStr(Local2, 1, 1)) == 131 ) )
         Local3 := bin2l(SubStr(Local2, 5, 4))
         Local4 := 1900 + bin2w(SubStr(Local2, 2, 1))
         Local5 := bin2w(SubStr(Local2, 3, 1))
         Local6 := bin2w(SubStr(Local2, 4, 1))
         Local9 := Set(_SET_DATEFORMAT, "mm/dd/yyyy")
         Local7 := CToD(Str(Local5, 2) + "/" + Str(Local6, 2) + "/" + ;
            Str(Local4, 4))
         set date format to Local9
      endif
      fclose(Local1)
   endif
   Local8 := padr(Arg1[ 1 ], 15) + Str(Local3, 12) + "    " + ;
      DToC(Local7) + Str(Arg1[ 2 ], 12)
   return Local8

//---------------------------------------------------[top]-
//  DEFPATH
//
static function DEFPATH

   local Local1, Local2, Local3 := Set(_SET_DEFAULT)
   Local1 := Len(Local3)
   if ( ( Local2 := SubStr(Local3, Local1, 1), Local1 > 0 .AND. ;
         Local2 != ":" .AND. Local2 != "\" ) )
      Local3 := Local3 + iif( Local1 == 1, ":", "\" )
   endif
   return Local3

//---------------------------------------------------[top]-
//  PLAINDIRLI( Arg1 )
//
static function PLAINDIRLI( Arg1 )

   local Local1 := Arg1[ 1 ], Local2:= At(".", Local1)
   if ( Local2 != 0 )
      Local1 := padr(SubStr(Local1, 1, Local2 - 1), 9) + ;
         padr(SubStr(Local1, Local2 + 1), 4)
   else
      Local1 := padr(Local1, 13)
   endif
   return Local1 + Str(Arg1[ 2 ], 8) + "  " + DToC(Arg1[ 3 ])

//---------------------------------------------------[top]-
//  __DIR( Arg1 )
//
function __DIR( Arg1 )

   local Local1 := defpath()
   if ( Empty(Arg1) )
      ? "Database Files    # Records    Last Update     Size"
      aeval(directory(Local1 + "*.dbf"), { |_1| QOut(dbfdirline(_1)) ;
         })
   else
      if ( SubStr(Arg1, 2, 1) == ":" .OR. SubStr(Arg1, 1, 1) == "\" )
         Local1 := Arg1
      else
         Local1 := Local1 + Arg1
      endif
      aeval(directory(LTrim(Local1)), { |_1| QOut(plaindirli(_1)) })
   endif
   ? 
   return Nil

//---EOF


Use your Browser's BACK button to return to Function Listings