Page 1 of 1

what return .filesystem.read()?

Posted: Sun Jul 10, 2016 12:43 am
by RAFAEL HEBER
Hello,
Can anyone tell me what really return the function love.filesystem.read()?

like...
filename = "the/directory/to/the/file"
word=love.filesystem.read(filename)

I have a file contain just words that beginning with 'A' and I write the directory for the file, but when I print [love.graphics.print(word)] it says nil

How can I show the contents of the file?

Re: what return .filesystem.read()?

Posted: Sun Jul 10, 2016 2:49 am
by HugoBDesigner
love.filesystem takes directories that are withing the game files only (or the appdata corresponding folder for the game).

So, for example, if you have "test.txt" at the same level of your main.lua file, you'll only need love.filesystem.read("test.txt"), instead of "C:/Users/Username/Desktop/My Game/test.txt".

At least I assume that's your problem. I can't help much with the information given.