Robert Wohlfarth <rbwohlfa...@gmail.com> writes:

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

Nice... much better.  That test would come in handy instead of comparing  the
whole list of files to the current one incoming.  It would find the
case where an extension was needed right off.

Still need to know if the directory is empty right up front though.
And should really print a list of whats in it, Before asking user if
they want to continue.

Its at least as likely that user would sooner clear the
directory... rather than fuss with extensions or comparisons.

I didn't mention it in first posts but this directory will be used
again and again for symlinking... in most cases whats in the directory
will not be important...  Whereas whats coming in will, and so better
off being cleared so the incoming files can retain there exact names.

There may be usage where a series of searchs will be done and all
symlinks will be needed, hence the worry about unique names.

So it needs to be up to the user but most often any files in the
directory will not be of concern.


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to