comparison scripts/miscellaneous/copyfile.m @ 6210:12b676a0b183 before-graphics-branch

[project @ 2006-12-07 02:37:17 by jwe]
author jwe
date Thu, 07 Dec 2006 02:37:17 +0000
parents 2eb0723b4fad
children a299c8a6d96e
comparison
equal deleted inserted replaced
6209:15b299f6803d 6210:12b676a0b183
35 35
36 status = true; 36 status = true;
37 msg = ""; 37 msg = "";
38 msgid = ""; 38 msgid = "";
39 39
40 ## FIXME -- maybe use the same method as in ls to allow users control
41 ## over the command that is executed.
42
43 if (ispc () && ! isunix () && isempty (file_in_path (EXEC_PATH, "cp")))
44 cmd = "cmd /C xcopy /E";
45 cmd_force_flag = "/Y";
46 else
47 cmd = "cp -r";
48 cmd_force_flag = "-f";
49 endif
50
40 if (nargin == 2 || nargin == 3) 51 if (nargin == 2 || nargin == 3)
41 if (nargin == 3 && strcmp (force, "f")) 52 if (nargin == 3 && strcmp (force, "f"))
42 cmd = "/bin/cp -rf"; 53 cmd = strcat (cmd, " ", cmd_force_flag);
43 else
44 cmd = "/bin/cp -r";
45 endif 54 endif
46 55
47 ## Allow cell input and protect the file name(s). 56 ## Allow cell input and protect the file name(s).
48 if (iscellstr (f1)) 57 if (iscellstr (f1))
49 f1 = sprintf("\"%s\" ", f1{:}); 58 f1 = sprintf("\"%s\" ", f1{:});