I am using scilab and I have a file I want to copy and backup. The copied file should have the date when it was copied on its name e.g 'Read.dat' to become 'Read_12-April-2014.dat'. I only manage to copy the file but the date does not appear.

copyfile('Read.dat','Archive/Read_'dt=date()'.dat')
有帮助吗?

解决方案

This seems related tot How to use the current date as name for a CSV file.

src_name_string = 'Read.dat';
dst_name_string  = 'Archive/Read_' + date() + '.dat';

copyfile(src_name_string, dst_name_string);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top