[Solved] love.filesystem.write problem

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
SPlice
Prole
Posts: 48
Joined: Thu Jul 28, 2011 8:53 am

[Solved] love.filesystem.write problem

Post by SPlice »

I have been trying to get love to create folders or .lua files and it does not seem to work at all. I have tried some code bits I found on the forums, mainly

Code: Select all

love.filesystem.setIdentity("filetest")
love.filesystem.write("test.lua", "love.draw = function() love.graphics.print('hello', 10, 10) end")
I have tried similar code to make a folder and nothing shows up. I have taken code from other love programs, I have looked at the wiki, and the forums to try to find a solution and I have not been able. Anyone have any ideas? what am I messing up? Is there some other simple test code that's known to work that I might try?

I am on windows 7 I have love 0.7.2 I have tried giving love administrator rights.
Last edited by SPlice on Tue Aug 02, 2011 12:02 am, edited 2 times in total.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: love.filesystem.write problem

Post by bartbes »

Where are you looking for this folder?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: love.filesystem.write problem

Post by Robin »

Administrator rights should not be necessary (otherwise LÖVE would complain or fail when you try running it without them, anyway).

Have you tried making another game with as main.lua:

Code: Select all

love.filesystem.setIdentity("filetest")
require 'test'
?

That should work, and then you can use Windows Explorer to search for test.lua.
Help us help you: attach a .love.
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

Re: love.filesystem.write problem

Post by Lap »

Put this into your windows explorer address bar

"%appdata%/love/filetest

viola
SPlice
Prole
Posts: 48
Joined: Thu Jul 28, 2011 8:53 am

Re: love.filesystem.write problem

Post by SPlice »

ah thanks, I was able to get it to make the file in the appdata/roaming/love/filetest folder. I was thinking the folder would be created in the project folder, D:\love\filetest. it seems inconvenient to send them into the bowls of my hard drive. I'm trying to generate arrays to use in tile maps, and I would like to be able to store them within the project folder, if that's not possible I suppose I can adapt.

on a side note I found all the files I have tried to generate over the last week in that folder. :rofl:

btw thanks for the help!
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: love.filesystem.write problem

Post by Robin »

Lap wrote:"%appdata%/love/filetest
I didn't know Windoze Exploder was smart enough to do that. ;)

The reason for this whole business is that the write location is normally writeable for non-administrator applications. If you were to place your game in, say Program Files, a game that saved files would need administrator rights to be able to run.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest