Hollywood10 Amiga - copyfile saveerror

Report any Hollywood bugs here
Post Reply
User avatar
fingus
Posts: 269
Joined: Fri Sep 16, 2011 9:53 am

Hollywood10 Amiga - copyfile saveerror

Post 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
User avatar
jPV
Posts: 604
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Hollywood10 Amiga - copyfile saveerror

Post 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.
User avatar
fingus
Posts: 269
Joined: Fri Sep 16, 2011 9:53 am

Re: Hollywood10 Amiga - copyfile saveerror

Post 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.
Post Reply