in reply to store a warning in a variable

A better approach is to check whether the directory exists first, for example use -d.

Don't handle known conditions as "exceptional" ones.

Peter (Guo) Pei

Replies are listed 'Best First'.
Re^2: store a warning in a variable
by bazong (Initiate) on Nov 10, 2010 at 09:16 UTC
    First of all: Thanks to all replies. It helped me very much!

    Usually i would agree with Peter to check first, if the folder exists. In my case the folder is a mounted share folder from a different server. It should be mounted all the time. I try to handle the exception if this mount doesn't work.
    - normal case: files to copy found or no files found
    - exception: directory NOT found

    cheers Michael