kascedi.blogg.se

File scavenger version 5 logo
File scavenger version 5 logo










"E:/Ruth" contains File: "e:/Ruth/Robert Passport.pdf" "E:/Ruth" contains File: "e:/Ruth/Thumbs.db" True -> (catch ForEachFileFound(Top_Directory,FileOrDir))ģ> Folder = fun(Parent,F) -> io:format("\n\t~p contains Folder: ~p~n",) end.Ĥ> File = fun(Parent,F) -> io:format("\n\t~p contains File: ~p~n",) end.ĥ> file_scavenger_utilities:spread_directory(Dir,TopDir,File,Folder). ?MODULE:spread_directory(FileOrDir,Top_Directory,ForEachFileFound,ForEachDirFound) (catch ForEachDirFound(Top_Directory,FileOrDir)), When is_function(ForEachFileFound),is_function(ForEachDirFound) ->įileOrDir = filename:absname_join(Dir,X), Spread_directory(Dir,Top_Directory,ForEachFileFound,ForEachDirFound)

file scavenger version 5 logo

File scavenger version 5 logo full#

%% Directory) is registered by its full path. The process of spreading goes on and on until every File (wether its in a nested %% erlang process that will spread the found Directory too in the same way as the parent directory %% Both funs above take the parent Dir as the first Argument. %% If it finds a directory, it executes the fun %% ForEachDirFound/2. %% Enters a directory and executes the fun ForEachFileFound/2 for each file it finds %% Should include the file extension as well e.g "C:/Program Files/SomeFile.pdf" %% Must be containing forward slashes, not back slashes. %% but this is right: "C:/Program Files/SomeDirectory" %% after the exact directory.e.g this is wrong: "C:/Program Files/SomeDirectory/"

file scavenger version 5 logo

I'll give an example of each quickly here using a list of files returned from file:list_dir/1: ])).Įrror_logger:error_report([" * File Scavenger Utilities Error * ", The big question comes down to this: What do you want to do with the files? Do you want to total something up for the files (ie, total file size or something), or do you want to store some value for each file (ie each file size individually) or do you want to do something to the files and you don't care what the return values for those files are (ie renaming each file)? There are two main ways one iterates over a list of something in a functional language like Erlang: map and fold. It's tough to recommend exactly which method you should use because your "do something" pseudocode is too vague.










File scavenger version 5 logo