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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. File Open

File Open

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 6 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

    Why I can't use "\\servername\....\test.txt"? When I use full path "c:\....\test.txt" it is fine.

    P S D 3 Replies Last reply
    0
    • A Anonymous

      Why I can't use "\\servername\....\test.txt"? When I use full path "c:\....\test.txt" it is fine.

      S Offline
      S Offline
      Steven M Hunt
      wrote on last edited by
      #2

      Are you using CreateFile()? I got sick of that function for this reason and switched to the old file functions. example: FILE *file = fopen("\\servername\....\test.txt", "r");/*"r" means you're reading the file........*/ if (file) { while (!feof(file)) /*while the file has not reached end of file*/ { /*whatever........ go to cplusplus.com for a complete file function reference, type in "file functions" into the search field*/ } fclose(file);//close the file } -- Steve

      1 Reply Last reply
      0
      • A Anonymous

        Why I can't use "\\servername\....\test.txt"? When I use full path "c:\....\test.txt" it is fine.

        P Offline
        P Offline
        pma
        wrote on last edited by
        #3

        use "\\\\servername\\....\\test.txt" and it will work

        A 1 Reply Last reply
        0
        • P pma

          use "\\\\servername\\....\\test.txt" and it will work

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

          No it didn't work

          P P 2 Replies Last reply
          0
          • A Anonymous

            No it didn't work

            P Offline
            P Offline
            Peter Weyzen
            wrote on last edited by
            #5

            and you've tested the same filename string in a program like notepad? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [Santa Cruz Networks](http://www.santacruznetworks.com)

            1 Reply Last reply
            0
            • A Anonymous

              Why I can't use "\\servername\....\test.txt"? When I use full path "c:\....\test.txt" it is fine.

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

              How about a code snippet?


              Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

              1 Reply Last reply
              0
              • A Anonymous

                No it didn't work

                P Offline
                P Offline
                peterchen
                wrote on last edited by
                #7

                how about a code snippet and GetLastError() ?


                "Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
                sighist | Agile Programming | doxygen

                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