what return .filesystem.read()?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
RAFAEL HEBER
Prole
Posts: 13
Joined: Thu Jan 22, 2015 1:23 am

what return .filesystem.read()?

Post 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?
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

Re: what return .filesystem.read()?

Post 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.
@HugoBDesigner - Twitter
HugoBDesigner - Blog
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests