How to check if a file exists

This is a discussion on How to check if a file exists within the C++ Programming forums, part of the General Programming Boards category; How do I check if a file exists in my program?...

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    73

    How to check if a file exists

    How do I check if a file exists in my program?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,642

  3. #3
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    try opening it with an ifstream. If it fails it can't be open. If it can't be opened there is a better then normal chance it doesn't exist

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    73
    Thank you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 09:46 AM
  4. check if the file exists
    By ipe in forum C Programming
    Replies: 2
    Last Post: 03-15-2003, 08:18 AM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 02:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21