When was a file used by another program

42 views Asked by At

I have a file with a series of 750 csv files. I wrote a Stata that runs through each of these files and performs a single task. The files are quite big, and my program has been running for more than 12 hours.

Is there is a way to know which was the last of the csv files that was used by Stata? I would like to know if the code is somewhere near finishing. I thought that organizing the 750 files by "last used" would do the trick, but it does not.

Next time I should be more careful about signalling how the process is going... Thank you

2

There are 2 answers

0
AudioBubble On BEST ANSWER

From the OS X terminal, cd to the directory containing the CSV files, and run the command

ls -lUt | head

which should show your files, sorted by the most recent access time, limited to the 10 most recently accessed.

3
Roberto Ferrer On

On the most basic level you can use display and log your session:

clear
set more off

local myfiles file1 file2 file3

forvalues i = 1/3 {
    display "processing file`i'"
    // <do-something-with-file>
}

See also help log.