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. filehandling

filehandling

Scheduled Pinned Locked Moved C / C++ / MFC
c++linuxquestion
2 Posts 2 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.
  • K Offline
    K Offline
    khomeyni
    wrote on last edited by
    #1

    in the name of allah hello i want to find all the files name in a directory and then delete all the files that are copies : a.txt a(copy).txt: a(copy).txt must be deleted. how i can find the name of files with c++ commands and how i can delete them . also my os is linux if it is relative to os.i dont know that if i write in a correct thread? valhamdolelah.

    _ 1 Reply Last reply
    0
    • K khomeyni

      in the name of allah hello i want to find all the files name in a directory and then delete all the files that are copies : a.txt a(copy).txt: a(copy).txt must be deleted. how i can find the name of files with c++ commands and how i can delete them . also my os is linux if it is relative to os.i dont know that if i write in a correct thread? valhamdolelah.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      You can use SHFileOperation[^] with the FO_DELETE function and specifying a wild card like *(copy).*. Is it enough that you determine that the file is a copy with the filename? I could create a new file with the name a(copy).txt even though it would be a rare occurrence.

      «_Superman_» I love work. It gives me something to do between weekends.
      Microsoft MVP (Visual C++)

      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