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. Doubt in SHFileOperation !!!

Doubt in SHFileOperation !!!

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
4 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.
  • I Offline
    I Offline
    Ilamparithi
    wrote on last edited by
    #1

    Hi All, Iam not able to delete a directory, which has more than three dot(.)s in its name using SHFileOperation. But iam able to delete directory will two dot(.)s. Why this happens? Eg. Iam able to delete directory named "1212.1212". But, Iam not able to delete directory named "192.168.1.133". I get message as "Cannot delete file: cannot read from source file or disk". but the directory is present. How can i delete this directory?? Is this due to Dos Name problem?? With Best Regards, A.Ilamparithi

    R 1 Reply Last reply
    0
    • I Ilamparithi

      Hi All, Iam not able to delete a directory, which has more than three dot(.)s in its name using SHFileOperation. But iam able to delete directory will two dot(.)s. Why this happens? Eg. Iam able to delete directory named "1212.1212". But, Iam not able to delete directory named "192.168.1.133". I get message as "Cannot delete file: cannot read from source file or disk". but the directory is present. How can i delete this directory?? Is this due to Dos Name problem?? With Best Regards, A.Ilamparithi

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      At a guess, it looks like the directory name is being interpreted as an IP address. You may need to prepend additional information ro fully qualify the actual location of the directory. e.g. "C:\192.168.1.133" Roger Allen - Sonork 100.10016 Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...

      I 1 Reply Last reply
      0
      • R Roger Allen

        At a guess, it looks like the directory name is being interpreted as an IP address. You may need to prepend additional information ro fully qualify the actual location of the directory. e.g. "C:\192.168.1.133" Roger Allen - Sonork 100.10016 Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...

        I Offline
        I Offline
        Ilamparithi
        wrote on last edited by
        #3

        Hi I tried with full pathname only like the one you mentioned above. eg. SHFILEOPSTRUCT shFileOp; ZeroMemory(&shFileOp, sizeof(SHFILEOPSTRUCT)); _TCHAR *p="c:\\temp\\temp1\\192.168.1.133"; shFileOp.hwnd=NULL; shFileOp.wFunc=FO_DELETE; shFileOp.pFrom=p; //shFileOp.fFlags=FOF_SILENT/*|FOF_NOCONFIRMATION*/; SHFileOperation(&shFileOp); Regards, A.Ilamparithi

        J 1 Reply Last reply
        0
        • I Ilamparithi

          Hi I tried with full pathname only like the one you mentioned above. eg. SHFILEOPSTRUCT shFileOp; ZeroMemory(&shFileOp, sizeof(SHFILEOPSTRUCT)); _TCHAR *p="c:\\temp\\temp1\\192.168.1.133"; shFileOp.hwnd=NULL; shFileOp.wFunc=FO_DELETE; shFileOp.pFrom=p; //shFileOp.fFlags=FOF_SILENT/*|FOF_NOCONFIRMATION*/; SHFileOperation(&shFileOp); Regards, A.Ilamparithi

          J Offline
          J Offline
          John M Drescher
          wrote on last edited by
          #4

          Isn't the filename supposed to be double null termainated. That may cause a problem... Address of a buffer to specify one or more source file names. These names can be either fully qualified paths, or standard DOS wild cards such as "*.*". Although this member is declared as a null-terminated string, it is used as a buffer to hold multiple file names. Each file name must be terminated by a single NULL character. An additional NULL character must be appended to the end of the final name to indicate the end of pFrom. John

          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