http://qs321.pair.com?node_id=568698


in reply to Re^3: File transfer not working on server
in thread File transfer not working on server

yes i am using strict and warnings. The message I am getting is coming from my condition here:
if(!-d $destinationFile) { print "Destination Directory not found."; }
Saying: Destination Directory not found.

Replies are listed 'Best First'.
Re^5: File transfer not working on server
by izut (Chaplain) on Aug 22, 2006 at 10:41 UTC

    Modify your statement to this:

    unless (-d $destinationFile) { die "Destination directory not found: $!"; }

    It will die and show you why.

    Igor 'izut' Sutton
    your code, your rules.

      I don't think you will. -d doesn't set $! to anything useable. I get "Bad file descriptor" in $! after using -d no matter whether it succeeded or failed. The $^E seems to make more sense "The system cannot find the file specified" when failed, but "Access is denied" when successfull. In either case, nothing that'd help. (I'm using perl v5.8.7 under WinServer 2k3 SP1)