Page 1 of 1
Hollywood10 Amiga - copyfile saveerror
Posted: Tue Dec 12, 2023 11:09 am
by fingus
Code: Select all
execute("copy DH1:Empty_WBPattern.prefs ENV:Sys/WBPattern.prefs") ; works
copyfile("DH1:Empty_WBPattern.prefs", "ENV:Sys/WBPattern.prefs") ; write-error
Re: Hollywood10 Amiga - copyfile saveerror
Posted: Wed Dec 13, 2023 8:15 am
by jPV
fingus wrote: ↑Tue Dec 12, 2023 11:09 am
Code: Select all
copyfile("DH1:Empty_WBPattern.prefs", "ENV:Sys/WBPattern.prefs") ; write-error
Remember that you have to give a
directory as the destination for the
CopyFile() function, not a file name. Now it probably tries to access/create a "WBPattern.prefs/" directory but fails because there's a file with the same name already. If you want to define the destination file name, use the NewName table field, but in this case you can just use "ENV:Sys" as the destination.
Re: Hollywood10 Amiga - copyfile saveerror
Posted: Thu Jan 11, 2024 9:53 am
by fingus
jPV wrote: ↑Wed Dec 13, 2023 8:15 am
fingus wrote: ↑Tue Dec 12, 2023 11:09 am
Code: Select all
copyfile("DH1:Empty_WBPattern.prefs", "ENV:Sys/WBPattern.prefs") ; write-error
Remember that you have to give a
directory as the destination for the
CopyFile() function, not a file name. Now it probably tries to access/create a "WBPattern.prefs/" directory but fails because there's a file with the same name already. If you want to define the destination file name, use the NewName table field, but in this case you can just use "ENV:Sys" as the destination.
Thanks for the hint and your help, its working now.