comparison 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
comparison
equal deleted inserted replaced
6068:c9f0839c583f 6069:67b1a61a85ce
40 if (nargin == 3 && strcmp (force, "f")) 40 if (nargin == 3 && strcmp (force, "f"))
41 cmd = "/bin/mv -f"; 41 cmd = "/bin/mv -f";
42 else 42 else
43 cmd = "/bin/mv"; 43 cmd = "/bin/mv";
44 endif 44 endif
45 [err, msg] = system (sprintf ("%s %s %s", cmd, f1, f2)); 45
46 ## Allow cell input and protect the file name(s).
47 if (iscellstr (f1))
48 f1 = sprintf("\"%s\" ", f1{:});
49 else
50 f1 = sprintf("\"%s\" ", f1);
51 endif
52
53 [err, msg] = system (sprintf ("%s %s \"%s\"", cmd, f1, f2));
46 if (err < 0) 54 if (err < 0)
47 status = false; 55 status = false;
48 msgid = "movefile"; 56 msgid = "movefile";
49 endif 57 endif
50 else 58 else