Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: system call

  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    system call

    I used system() function to excute a command this command will include a path which contain white spaces, it seems for me that the system function does not except the white spaces, and it cut the path when it figure the white space... is there any solution????

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can try exec() instead..

    Sadiq.

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    on win32 ? just adding quotes around the path works I think .. else use shorthand .. c:/PROGRA~1/blah.exe etc

    exec('"c:/program files/blah.exe"');
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #4
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I haven't tried it myself, but actually I would think putting quotes around the bits with spaces would need the quotes:
    PHP Code:
    exec("c:/'program files'/blah.exe"); 
    So because program files is two words but a single directory, you'd put quotes around it. Using the command prompt on Windows XP. that's how I do it, so I assume it's the same here..

    Sadiq.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •