#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Location
    Auckland
    Posts
    93
    Rep Power
    24

    Waiting for Process to complete


    Hi ,

    I am currently writing a upload script with limitation that the actual destination is not a server. So I am using intermediate server to copy temporary file from this server to destination using "exec" ( /usr/bin/sudo cp source destination )


    This works perfectly fine. but the problem is , Since I am using "uploadify" lib; it just marks the process complete before exec() completes so won't give proper output & in background it copies the file.

    What I want here is to wait till exec completes its execution. ?

    or is there any alternative approach for this ?

    Please guide
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Location
    Auckland
    Posts
    93
    Rep Power
    24
    Originally Posted by ryand
    Hi ,

    I am currently writing a upload script with limitation that the actual destination is not a server. So I am using intermediate server to copy temporary file from this server to destination using "exec" ( /usr/bin/sudo cp source destination )


    This works perfectly fine. but the problem is , Since I am using "uploadify" lib; it just marks the process complete before exec() completes so won't give proper output & in background it copies the file.

    What I want here is to wait till exec completes its execution. ?

    or is there any alternative approach for this ?

    Please guide



    In fact, I will rephrase my question here...


    How to get status of copy command until it reaches to 100% ?
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,872
    Rep Power
    6351
    exec waits for the command to execute before your PHP moves on to the next line. Why do you believe it's not doing this?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo