Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Again with dir command
Message
De
12/03/2002 07:18:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
12/03/2002 06:19:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00631385
Message ID:
00631400
Vues:
30
>Another problem with this command:
>I need to retrieve informations about the date in which files where modified but i cannot get this information as i have to use jolly characters.
>I cannot use as i did before the adir command because of the number of files stored in the directory a i have to scan.
>Thank u again

Alessio,
Use filer utility. ie:
oFiler = createobject('filer.fileutil')
tcCursorName='crsFiles'
Create cursor (tcCursorName) ;
  (filepath c(100), filename c(50), filesize i, fattr i, created t, accessed t, modified t)
With oFiler
  .SearchPath = 'c:\myPath'
  .Subfolder = 1 && Include subfolders
  .SortBy = 1
  .FileExpression = '*.*'
  .Find(0)
  For ix=1 to .Files.Count
    With .Files(ix)
      If !(bittest(.Attr,4) and .Name = '.')
        Insert into (tcCursorName) ;
          (filepath, filename, filesize, fattr, created, accessed, modified)  ;
          values ;
          (.Path, .Name, .Size, .Attr, ;
          Num2Time(.DateTime), ;
          Num2Time(.LastAccessTime), ;
          Num2Time(.LastWriteTime))
      Endif
    Endwith
  Endfor
Endwith
*-- Converts a time in numeric format to datetime
Procedure Num2Time
  Lparameters tnFloat
  Return dtot({^1899/12/30}+int(tnFloat))+86400*(tnFloat-int(tnFloat))
Endproc
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform