[erlang-questions] erl_tar:add continue on error

Peer Stritzinger peerst@REDACTED
Sat Jun 8 09:41:15 CEST 2013


On 2013-06-07 20:15:39 +0000, Tiago Cury said:

> Hi, I'm using erl_tar:add to create a backup from my server, but when 
> it finds a kind of file type like socket it returns
> immediately with a tuple {error, 
> reason
> } and aborts the entire process.
> 
> Is there a way to erl_tar:add ignore these errors (skip just the bad 
> file) and continue the operation?

You could use filelib:fold_files to recurse over the tree calling 
erl_tar:add on what it findes.

According to its documentation it only recurses over regular files.

Cheers
-- Peer





More information about the erlang-questions mailing list