NekoMage Posted April 1, 2020 Share 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? Link to comment Share on other sites More sharing options...
Administrators Enyby Posted April 1, 2020 Administrators Share Posted April 1, 2020 Use io lib functions for open, read, write. Exec not supported. Link to comment Share on other sites More sharing options...
NekoMage Posted April 1, 2020 Author Share Posted April 1, 2020 Are io lib functions can copy or move some file except write, read, or open? Link to comment Share on other sites More sharing options...
Administrators Enyby Posted April 1, 2020 Administrators Share 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. Link to comment Share on other sites More sharing options...
NekoMage Posted April 1, 2020 Author Share Posted April 1, 2020 Ah I see, ok thank you so much for your help! Link to comment Share on other sites More sharing options...
Administrators Enyby Posted April 1, 2020 Administrators Share Posted April 1, 2020 For move file use os.rename. Link to comment Share on other sites More sharing options...
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?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.