1. Anders Ruud
  2. love
  3. Issues

Issues

Issue #86 resolved

love.filesystem.newFile(path) returns 'file does not exist'

Archinamon
created an issue

I just started learning love-engine and still don't know of 'famous' issues. I tried to print out _G in file and found that this example doesn't work for me: {{{

!lua

file = love.filesystem.newFile("data.txt") file:open('r') data = file:read() }}}

I created test project with _G.lua: {{{

!lua

class:publick 'OnInit' function OnInit:__init() local bg = love.graphics.newImage('testbg.jpg') local width = bg:getWidth() local height = bg:getHeight() local file = love.filesystem.newFile('data.txt')

file:open('r')
love.graphics.draw(bg,0,0)
love.graphics.print(file:read(),0,5)

end

love.draw = OnInit }}}

The main.lua is: {{{

!lua

require 'scripts/__mainreq' require 'scripts/_G' }}}

Version of Love i loaded is 0.6.2, beta-ver i didn't try yet.

Comments (5)

  1. Archinamon reporter

    Well, i thought that newFile() func creates it, isn't it? Anyway, i tried to load a pre-created file, but still no result with it... Maybe there is special chain of functions to be called?

  2. Log in to comment