Directory Watcher

20 ビュー (過去 30 日間)
Muhammad Arsalan
Muhammad Arsalan 2011 年 3 月 13 日
Hi,
I am working on auto generation of reports and i am stuck right now. My aim is to check a network disk (let's say Z:\) once every day and if someone has put new folders (data) in that network drive then my script will analyse that new data.
The concept that i am unable to grasp right now is how to handle following 2 cases:
Z:\MainFolder\myDesiredFolder
and 2nd case
Z:\MinaFolder\SubFolder\Subfolder\Subfolder\myDesiredFolder
You are welcome with any kind of suggestions, tips or ideas.
Many thanks in advance.
\\Arsalan

採用された回答

Oleg Komarov
Oleg Komarov 2011 年 3 月 13 日
You can use recursive directory listing in the following way:
dirs = folderSizeTree('D:\');;
Then you can store results across days and use setdiff to find which new folder were added.
Oleg
  5 件のコメント
Walter Roberson
Walter Roberson 2011 年 3 月 18 日
Reverse the order of your arguments to setdiff:
newfs = setdiff(folders2,folders1);
Muhammad Arsalan
Muhammad Arsalan 2011 年 3 月 18 日
Thanks Walter, now its working fine.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by