![curve fitting file deltagraph 7 curve fitting file deltagraph 7](https://i.stack.imgur.com/ztff8.png)
Then, I open that text file and read the names of the files line by line. I used the system() function to execute the 'ls' command and redirect an output to a text file. The first solution I did was not very elegant, but I could not find anything better. (If you just want the complete code: CleanUp.cpp uses the first solution for listing files CleanUp_new.cpp uses the second solution) Here are some code snippets for each of the steps. There are basically three steps to this: find a list of files in the given directory for each file find the modification time if the difference between the modification time and the current time is more than 2 hrs, delete the file. So, I started googling and found some hints (what would we do without the that lead to two (similar) solutions: the difference is the way the two scripts handle reading a list of files from the given directory. I have experience with c (not so much with c++), but I have never done any system level stuff like this, especially not on a pc.
CURVE FITTING FILE DELTAGRAPH 7 HOW TO
But I ran into a few challenges: how to get a list of files from a directory, how to find modification time for a file and how to delete a file. My second though was - well, I will have to do some c/c++ coding. There is nothing even similar to a bash 'find' command. But I soon found out that DOS scripting is very limited (to put it mildly). Here are the details of the code involved.Ĭoming from Unix, my first thought was to create a simple script, something equivalent to a shell script for this task. I learned a lot - from how to schedule tasks on a pc (see previous post) and what it takes to create "simple" "scripts" for simple (really simple) tasks. When we originally thought about creating this "script" I thought it would be very easy - we'll it was not. Recently, in a scope of a larger project I am working on (on a pc :-(), I needed to create a script that will run few times a day and delete all files that were created more then two hours ago from a certain directory.