Copy File
Moderators: Víctor Paredes, Belgarath, slowtiger
- MehdiZangenehBar
- Posts: 114
- Joined: Wed Feb 07, 2024 7:17 pm
- Contact:
Copy File
How we can copy / move a file using script?
- synthsin75
- Posts: 10265
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Copy File
Generally, you can use os.rename to change the path of a file: https://www.gammon.com.au/scripts/doc.php?lua=os.rename
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- MehdiZangenehBar
- Posts: 114
- Joined: Wed Feb 07, 2024 7:17 pm
- Contact:
Re: Copy File
Thanks! what about copy? we can use cp command right?synthsin75 wrote: ↑Sun Jun 30, 2024 12:05 am Generally, you can use os.rename to change the path of a file: https://www.gammon.com.au/scripts/doc.php?lua=os.rename
- synthsin75
- Posts: 10265
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Copy File
You can either read a file and write it to a new one using the Lua IO library, or use whatever commands are available using os.execute.
The latter option would have to take into account different OS commands.
The latter option would have to take into account different OS commands.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- MehdiZangenehBar
- Posts: 114
- Joined: Wed Feb 07, 2024 7:17 pm
- Contact:
Re: Copy File
Got it, Thanks.synthsin75 wrote: ↑Sun Jun 30, 2024 8:10 pm You can either read a file and write it to a new one using the Lua IO library, or use whatever commands are available using os.execute.
The latter option would have to take into account different OS commands.