in reply to Testing if file exists

The code posted should work, if the relative path is relative to the current working directory. The -e operator only tells you that the path exists, if you really want to know if it is a file, you should check out the -f operator. Also, if you are working in a windows environment, make sure that $mall_path has any \ escaped to \\ or you may have issues with variable interpolation.

May the Force be with you

Replies are listed 'Best First'.
Re^2: Testing if file exists
by hoffj (Initiate) on Oct 05, 2004 at 12:10 UTC
    -e vs -f?

    The references I'm looking at say that:
    -e is true if file exists
    -f is true if file is a plain file

    Is this info out-of-date/incorrect or am I missing something?

      The problem is that -e will return true even if the specified "path" or "file" is actually a directory.

      May the Force be with you