Home » Console » Console_Getopt » Bug #1499
Console_Getopt does not support args with spaces
Details
| Submitted | 2004-05-25 23:26 UTC |
|---|---|
| From | crain at fuse dot net |
| Status | Bogus |
| Package | Console_Getopt |
| PHP Version | 4.3.2 |
| OS | WinXP Pro |
| Roadmaps | (Not assigned) |
Comments
[2004-05-25 23:26 UTC] crain at fuse dot net
Description:
------------
System::mkDir() fails to create directory if the supplied path name has one or more spaces in it, since it calls _parseArgs() which splits the path name on spaces ($argv = preg_split('/\s+/', $argv)). See discussion at http://marc.theaimsgroup.com/?l=seagull-general&m=108552405731570&w=2
for more info.
Using
// $Id: System.php,v 1.10 2004/05/05 19:37:43 cvsroot Exp $
I work around this by passing the directory to mkDir() as an array rather than as a string, but this doesn't follow the api.
Thanks!
Andy
[2004-05-28 08:21 UTC] cox at idecnet dot com
From the System.php source:
* In case you need to to pass file names with spaces,
* pass the params as an array:
*
* System::rm(array('-r', $file1, $dir1));
The API is documented to work so (http://pear.php.net/manual/en/core.pear.system.intro.php). Anyway this is a problem in Console_Getopt not handling args with spaces, that's why we support both modes. Even supporting them, the cost of quoting each arg would be bigger that just passing an array.
Tomas V.V.Cox
Reclassified as Console_Getopt issue
[2004-05-28 15:13 UTC] crain at fuse dot net
Oops, clearly I hadn't gone over the comments closely enough. Sorry about that. Anyway, now a bug search at least will turn up this information. As long as passing in an array is anticipated and OK, I'm happy! Should I close this bug?