Results 1 to 4 of 4

Thread: get the detail of files

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    49
    is there an api that give you the oppurtunity to get info of a specific file like (File size,Date-time created,Date-time last modidied,etc....)

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    Add the Microsoft Scripting Runtime DLL to your project (go to PROJECT / REFERENCES and find it)

    Then;

    Code:
    Dim FSO as New FileSystemObject
    Dim MyFile as File
    
    Set MyFile=FSO.GetFile("[filename]")
    You can then use;

    MyFile.DateCreated for the creation date.
    MyFile.DateLastAccessed for the last access date.
    MyFile.DateLastModified for the modified date.
    MyFile.Size for the size of the file
    MyFile.Attributes to get the attributes of the file - check out the help file for more info.


    and much more. The MS Scripting Runtime object is very useful in any program that needs to know things about the file system.

    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    49

    thanxs just another thing

    for the attributes , they give you a number is there a way to get like read or something else

  4. #4
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    Here you go:

    0 - normal
    1 - read only
    2 - hidden
    4 - system
    8 - volume
    16 - directory
    32- archive
    64 - alias
    128 - compress

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width