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. Problem with CopyFileW

Problem with CopyFileW

Scheduled Pinned Locked Moved C / C++ / MFC
helpjson
5 Posts 3 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.
  • S Offline
    S Offline
    stanlymt
    wrote on last edited by
    #1

    I'm using CopyFileW to copy a temporary downloaded file to proper location. But in a rare scenario, CopyFileW didnt return any error but first 198,324 bytes of 454,086 bytes of destination file was written empty, rest of data is copied properly. This was used on Windows XP. Please tell me where would have gone wrong.

    K D 2 Replies Last reply
    0
    • S stanlymt

      I'm using CopyFileW to copy a temporary downloaded file to proper location. But in a rare scenario, CopyFileW didnt return any error but first 198,324 bytes of 454,086 bytes of destination file was written empty, rest of data is copied properly. This was used on Windows XP. Please tell me where would have gone wrong.

      K Offline
      K Offline
      KarstenK
      wrote on last edited by
      #2

      Looks like the download was not complete. Start the Copy FileW only after you are shure that the download is complete.

      Greetings from Germany

      S 1 Reply Last reply
      0
      • S stanlymt

        I'm using CopyFileW to copy a temporary downloaded file to proper location. But in a rare scenario, CopyFileW didnt return any error but first 198,324 bytes of 454,086 bytes of destination file was written empty, rest of data is copied properly. This was used on Windows XP. Please tell me where would have gone wrong.

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

        stanlymt wrote:

        ...CopyFileW didnt return any error...

        Did it return a nonzero value?

        "Love people and use things, not love things and use people." - Unknown

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        S 1 Reply Last reply
        0
        • K KarstenK

          Looks like the download was not complete. Start the Copy FileW only after you are shure that the download is complete.

          Greetings from Germany

          S Offline
          S Offline
          stanlymt
          wrote on last edited by
          #4

          Download was successful and temporary file is perfect!!! But when it is copied it did return a nonzero value but the destination file was corrupted.

          1 Reply Last reply
          0
          • D David Crow

            stanlymt wrote:

            ...CopyFileW didnt return any error...

            Did it return a nonzero value?

            "Love people and use things, not love things and use people." - Unknown

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            S Offline
            S Offline
            stanlymt
            wrote on last edited by
            #5

            It did return a nonzero value otherwise it would give a download error.

            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