Files
SyncHome/trunk/ulp/pcb-gcode-3.6.0.4/source/filecopy.h

27 lines
543 B
C
Raw Normal View History

2023-03-09 10:24:21 +00:00
// -*- Mode: Eagle -*-
void filecopy(string from_name, string to_name)
{
string contents[];
int num_lines;
fileerror();
num_lines = fileread(contents, from_name);
if(fileerror()) {
dlgMessageBox("Error: Could not open " + from_name
+ " for copying to " + to_name);
exit(1);
}
output(to_name) {
for (int i=0; i < num_lines; i++) {
printf("%s\n", contents[i]);
}
}
if(fileerror()) {
dlgMessageBox("Error: Could not write the contents of "
+ from_name + " to " + to_name);
exit(1);
}
}