Results 1 to 5 of 5

Thread: Easy Question. Does the file exist?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    15

    Talking

    I think my qusetion is very easy but I don't know how
    to do it...

    How can I know if a file exist?

    I'm not like them
    but I can pretend

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Use the Dir function. You can get info on using it at msdn.microsoft.com/library/default.asp Look at the toc and goto Microsoft Visual Studio-->Visual Basic-->Reference-->Language Reference-->Functions-->D-->Dir
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  3. #3
    Guest
    Code:
    If Dir$("MyFile") Then
        'File exist
    Else
        'File does not exist
    End If

  4. #4
    Junior Member
    Join Date
    Aug 2000
    Posts
    19
    I always use the Filelen(pathname) function. This determines the size of the file in bytes. For example:


    If Filelen("C:\Windows\Win.exe) > 0 then
    'file exists
    Else
    'file doesn't exist (figures)
    End if


    Hope this helps!

    Dave.

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    15

    Thumbs up Thanks :)

    Thanks to all of you

    you're quick.

    It almost faster than the MSDN. And I didn't want to search
    into that.
    I'm not like them
    but I can pretend

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