NekoMage Posted April 1, 2020 Posted April 1, 2020 Hi I'm new in here, how to move/copy a file with lua script? Like this If using terminal cp file1.txt file2.txt Or mv file1.txt new-file1.txt How to copy like that? Are GG had a function like exec function?
Administrators Enyby Posted April 1, 2020 Administrators Posted April 1, 2020 Use io lib functions for open, read, write. Exec not supported.
NekoMage Posted April 1, 2020 Author Posted April 1, 2020 Are io lib functions can copy or move some file except write, read, or open?
Administrators Enyby Posted April 1, 2020 Administrators Posted April 1, 2020 Copying a file is not magic. The cp utility opens two files, one for reading, one for writing, and then copying the contents. All this can be done on Lua.
NekoMage Posted April 1, 2020 Author Posted April 1, 2020 Ah I see, ok thank you so much for your help!
Administrators Enyby Posted April 1, 2020 Administrators Posted April 1, 2020 For move file use os.rename.
Question
NekoMage
Hi I'm new in here, how to move/copy a file with lua script? Like this
If using terminal
cp file1.txt file2.txt
Or
mv file1.txt new-file1.txt
How to copy like that? Are GG had a function like exec function?
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.