How can I check if the content of a folder was changed

Мне нужна процедура, которая проверяет, были ли новые папки / файлы добавлены в данную выбранную папку. I need this procedure to run upon application start up so the processing time at this stage is important.

I guess I can make a log of current state, log of the previous state, sort and compare them.

  1. First I need to know if there is another way.

  2. Second if there is no other way what is the best way to find difference between two lists of files paths: both structure and algorithms.

Old state:

c:\firstfolder\a.doc
c:\firstfolder\b.doc
c:\firstfolder\secondFolder\a.doc
c:\firstfolder\secondFolder\b.doc

New state:

c:\firstfolder\a.doc
c:\firstfolder\b.doc 
c:\firstfolder\secondFolder\a.doc 
c:\firstfolder\secondFolder\b.doc 
c:\firstfolder\secondFolder\c.doc

I'm looking for c:\firstfolder\secondFolder\c.doc.

7
задан John Kugelman supports Monica 4 September 2010 в 19:20
поделиться