On Sun, Mar 7, 2010 at 11:37 AM, Harry Putnam <rea...@newsguy.com> wrote:

> I want to know if the receiving directory is empty of actual files.
> Since if it is not; then first the user must be asked if she wants to
> continue, if so, then a subfunction must be employed to ensure nothing
> is clobbered.
>
> The subfunction  compares incoming filenames to any filenames
> present in the receiving directory and adds a numeric extension if
> there are any matches; to guarantee a unique filename.
> That code is a little more involved since some of the filenames present
> may well already have extensions
>

The "-e" test will tell you if the target file already exists. For example:
if (-e $copyToFile) {
    # Add extension here...
}

-- 
Robert Wohlfarth

Reply via email to