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