Mercurial > hg > octave-lyh
diff scripts/miscellaneous/movefile.m @ 6069:67b1a61a85ce
[project @ 2006-10-21 14:33:53 by jwe]
author | jwe |
---|---|
date | Sat, 21 Oct 2006 14:33:54 +0000 |
parents | 176f1c58a474 |
children | 12b676a0b183 |
line wrap: on
line diff
--- a/scripts/miscellaneous/movefile.m +++ b/scripts/miscellaneous/movefile.m @@ -42,7 +42,15 @@ else cmd = "/bin/mv"; endif - [err, msg] = system (sprintf ("%s %s %s", cmd, f1, f2)); + + ## Allow cell input and protect the file name(s). + if (iscellstr (f1)) + f1 = sprintf("\"%s\" ", f1{:}); + else + f1 = sprintf("\"%s\" ", f1); + endif + + [err, msg] = system (sprintf ("%s %s \"%s\"", cmd, f1, f2)); if (err < 0) status = false; msgid = "movefile";