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. Finding a file

Finding a file

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    How do i find whether a file is present in a directory or not?

    V T 2 Replies Last reply
    0
    • A Anonymous

      How do i find whether a file is present in a directory or not?

      V Offline
      V Offline
      vikram attiganal
      wrote on last edited by
      #2

      /* Check for existence */ if( (_access( "filename, with full path", 0 )) != -1 ) { //file exists } This will do the trick for you

      A 1 Reply Last reply
      0
      • V vikram attiganal

        /* Check for existence */ if( (_access( "filename, with full path", 0 )) != -1 ) { //file exists } This will do the trick for you

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        will the same trick work to find the existence of a directory

        G 1 Reply Last reply
        0
        • A Anonymous

          will the same trick work to find the existence of a directory

          G Offline
          G Offline
          gillou1664
          wrote on last edited by
          #4

          Why people never take a look at the msdn before asking something?:confused: In 90% of the time, you will have the answer in less than 1 min. Like in this case... http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/\_crt\_\_access.2c\_.\_waccess.asp Mangez des gnous!

          1 Reply Last reply
          0
          • A Anonymous

            How do i find whether a file is present in a directory or not?

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            use api PathFileExist() this will help you above cause ----------------------------- "I Think It will Work" Formerly Known As "Alok The Programmer" at CP ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk

            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