Old 11-04-2015, 12:33 AM   #1
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default What the easiest way to move/copy files in lua?

Is reading/writing content right way?
Like this
Code:
file = io.open(source_filename, "r")
source_content = file:read("*all")
file = io.open(destination_filename, "w+")
file:write(source_content)
Or maybe IO library has oneline functions for this?
os.execute is a not a solution, I guess, until it is OS dependent.
mpl is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.