#23930 [Opn->Asn]: Archive_Tar::createModify can't handle paths with spaces

From: Date: Sun, 01 Jun 2003 06:28:20 +0000
Subject: #23930 [Opn->Asn]: Archive_Tar::createModify can't handle paths with spaces
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16869@lists.php.net to get a copy of this message
ID: 23930 Updated by: et@php.net Reported By: greg at chiaraquartet dot net -Status: Open +Status: Assigned Bug Type: PEAR related Operating System: Windows XP PHP Version: 4.3.2 -Assigned To: +Assigned To: vblavet New Comment: Actually, that is almost what it is doing. It accepts a string (space-delimited) or an array of path/filenames. So, if you have something that contains spaces, all you have to do is put them into an array. $foo->createModify(array('path/with spaces/to/file')); I suggest leaving it as-is, because it would break BC otherwise. Quoting/escaping would be nice, but is not really neccessary, i think. One easy thing that one could do though is introducing a 5th parameter (optional) specifying the delimiter for the filelist, defaulting to a space. Assigning this to the maintainer, he should decide what do to. Previous Comments: ------------------------------------------------------------------------ [2003-05-31 20:24:19] greg at chiaraquartet dot net perhaps the best solution is to allow either a string (single filename) or an array of strings (multiple filenames) ------------------------------------------------------------------------ [2003-05-31 18:34:08] et@php.net et@edea:/tmp/foo$ touch foo\:bar et@edea:/tmp/foo$ touch foo\;bar et@edea:/tmp/foo$ ls foo:bar foo;bar ; and : are perfectly allowable characters, just like a space. the solution would rather be to a) quote the filenames and b) allow escaping of characters, but that is not a simple thing to do. ------------------------------------------------------------------------ [2003-05-31 17:50:57] greg at chiaraquartet dot net the createModify parameter specification allows files separated by spaces, or a single filename. This does not take into account the possibility of directories with spaces in them. The best solution is to change the space to an impossible OS character, such as : or ; (this is why include_path uses : instead of spaces). This affects all aspects of the pear packaging process as well, so changes here will require changes elsewhere that Archive_Tar is used. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23930&edit=1

« previous php.pear.dev (#16869) next »