Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I save into a specific folder?

While learning how to create Lua file output code with the support of LÖVE, I've always hated that LÖVE filesystem handler always saved the specific file somewhere in C:/Documents and Settings/...

How can I create a code that saves a file into a specific folder that I'd like to define (and maybe to change while running the application)?

like image 267
Zoltán Schmidt Avatar asked Nov 03 '13 22:11

Zoltán Schmidt


1 Answers

The love.filesystem library doesn't let you do anything outside the sandbox. However, LÖVE doesn't disable Lua's built in io library, so you can use io.open to open files outside the sandbox and read/write them as normal, as well as other Lua functions like require and loadfile.

It also doesn't restrict loading of external modules, so you can (for example) require "lfs" to load LuaFileSystem and use that, if it is installed.

like image 94
ToxicFrog Avatar answered Oct 04 '22 16:10

ToxicFrog