Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. check if a file exists

check if a file exists

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hyling
    wrote on last edited by
    #1

    What function should I use to check if a file exists? I came across it when I didn't need it, now that I need it I can't find it. :( Gotta love how that works. :-D Thanks! Hua-Ying

    M D B 3 Replies Last reply
    0
    • H hyling

      What function should I use to check if a file exists? I came across it when I didn't need it, now that I need it I can't find it. :( Gotta love how that works. :-D Thanks! Hua-Ying

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      PathFileExists() in shlwapi.h -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!

      H 1 Reply Last reply
      0
      • H hyling

        What function should I use to check if a file exists? I came across it when I didn't need it, now that I need it I can't find it. :( Gotta love how that works. :-D Thanks! Hua-Ying

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        You can also use _access().


        "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

        H 1 Reply Last reply
        0
        • M Michael Dunn

          PathFileExists() in shlwapi.h -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!

          H Offline
          H Offline
          hyling
          wrote on last edited by
          #4

          Thanks, love your signature! :laugh: Hua-Ying

          1 Reply Last reply
          0
          • D David Crow

            You can also use _access().


            "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

            H Offline
            H Offline
            hyling
            wrote on last edited by
            #5

            Thanks, I'll take a look at that! Hua-Ying

            1 Reply Last reply
            0
            • H hyling

              What function should I use to check if a file exists? I came across it when I didn't need it, now that I need it I can't find it. :( Gotta love how that works. :-D Thanks! Hua-Ying

              B Offline
              B Offline
              Blake Miller
              wrote on last edited by
              #6

              You can also use GetFileAttributes() You can also use CreateFile and try to open Existing You can also use FindFirstFile You can also use CFile You can also use fopen :omg:

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups