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. how to create and delete directory from MFC?

how to create and delete directory from MFC?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++htmltutorial
4 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.
  • B Offline
    B Offline
    Binayak
    wrote on last edited by
    #1

    Hi, I have following questions: 1. How do I create a directory in MFC? 2. When my application exists I want to delete the directory. How to do that? 3. In the directory I want to keep a feh html files. Users can look at the htmls when the application is running. When the applications exists I want to do the following a) check any of those html files are open...How? b) close them ...how? c) delete them...how? e) delete the parent directory. Please advise.

    G J S 3 Replies Last reply
    0
    • B Binayak

      Hi, I have following questions: 1. How do I create a directory in MFC? 2. When my application exists I want to delete the directory. How to do that? 3. In the directory I want to keep a feh html files. Users can look at the htmls when the application is running. When the applications exists I want to do the following a) check any of those html files are open...How? b) close them ...how? c) delete them...how? e) delete the parent directory. Please advise.

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__chdir.2c_._wchdir.asp[^] 1) See _mkdir 2) See _rmdir 3) To Test if a file is open ... hmm .. maybe see if you can open it in exclusive mode - if you cant, then its already open by something else ?? Those functions are the lowest level way of doing things - there are MFC wrappers for such I beleive - look around a bit more, dontget us to do all your work for you Grinch

      1 Reply Last reply
      0
      • B Binayak

        Hi, I have following questions: 1. How do I create a directory in MFC? 2. When my application exists I want to delete the directory. How to do that? 3. In the directory I want to keep a feh html files. Users can look at the htmls when the application is running. When the applications exists I want to do the following a) check any of those html files are open...How? b) close them ...how? c) delete them...how? e) delete the parent directory. Please advise.

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

        a, b and c are not trivial. You need to do something like the following link (without the fancy gui): http://www.sysinternals.com/ntw2k/freeware/procexp.shtml[^] John

        1 Reply Last reply
        0
        • B Binayak

          Hi, I have following questions: 1. How do I create a directory in MFC? 2. When my application exists I want to delete the directory. How to do that? 3. In the directory I want to keep a feh html files. Users can look at the htmls when the application is running. When the applications exists I want to do the following a) check any of those html files are open...How? b) close them ...how? c) delete them...how? e) delete the parent directory. Please advise.

          S Offline
          S Offline
          Shanmuga Sundar
          wrote on last edited by
          #4

          hey well This can be done very easy. Just u make use of the system(command) This system function is used to execute the dos commands. So u have to specify like system("md directoryname"); This will execute the dos command so that ur directory would created to delete do the same. to open the file just use _open to read or write the file just use _read or _write. I hope u better refer the msdn where u could be clear man. Just try this i hope this would be helpfull for u. Bye ..... Shanmuga Sundar.V

          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