http://pastebin.com/jqETiCvD
Remember, Windows only. I'll work on a Mac and a Linux (Korn and Bash shell) version later, once I figure out how to use the terminal on those... since I only work with Windows, I don't know much about those.
mkdir(parentDir, dirName) -- Creates a directory of the name dirName inside the directory parentDir.
mkfile(parentDir, fileName, fileContents) -- Creates a file of the name fileName containing the contents fileContents. fileContents supports newlines, it should be used with long strings.
getUser() -- shorthand for love.filesystem.getUserDirectory()
getSave() -- shorthand for love.filesystem.getSaveDirectory()
Example code:
Code: Select all
function love.load()
mkdir(getUser().."\\Desktop","love2Ddir")
mkfile(getUser().."\\Desktop\\love2Ddir","example.txt",[[
This is a test message.
Hello from Love2D!]])
end