- Timestamp:
- 07/17/09 13:40:38 (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
doc/TODO (modified) (1 diff)
-
src/directory_watcher.erl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/TODO
r80 r81 10 10 ----------------------- 11 11 12 What happens if you do a cd(...) in the shell while directory_tester13 is running (try with an absolute path and with a relative path in the14 init args)?15 16 Try running directory_tester from erl started with various -pa17 (relative, absolute, ../ etc).18 19 12 Features? 20 13 --------- -
trunk/src/directory_watcher.erl
r80 r81 10 10 init (Directory, F) -> 11 11 D = filename: absname (Directory), 12 check (D, F, []).12 check (D, F, dict: new ()). 13 13 14 14 init_recursive (Directory, F) -> … … 20 20 check (Directory, F, State) -> 21 21 New_state = list_dir (Directory, F), 22 sort_and_compare (F, State, New_state),22 compare (F, State, New_state), 23 23 loop (Directory, F, New_state). 24 24 … … 31 31 list_dir (Directory, F, Error) -> 32 32 F ({directory, Directory, Error}), 33 [].33 dict: new (). 34 34 35 35 read_state (Filenames) -> 36 lists: foldl (fun read_state/2, [], Filenames).36 lists: foldl (fun read_state/2, dict: new (), Filenames). 37 37 38 read_state (File name, State) ->39 case file: read_file_info (File name) of38 read_state (File_name, State) -> 39 case file: read_file_info (File_name) of 40 40 {ok, Info} -> 41 [{Filename, value (Info#file_info.type, Filename)} | State]; 41 Value = value (Info#file_info.type, File_name), 42 dict: store (File_name, Value, State); 42 43 _ -> 43 44 State … … 80 81 end. 81 82 82 sort_and_compare (F, Old, New) -> 83 Original = dict: from_list (Old), 84 Modified = dict: from_list (New), 83 compare (F, Original, Modified) -> 85 84 Compared = adlib: compare_dict (Modified, Original), 86 85 dict: fold (fun notify_new/3, F, dict: fetch (new, Compared)),
Note: See TracChangeset
for help on using the changeset viewer.
