newThread filename path restrictions

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
Nikki
Citizen
Posts: 83
Joined: Wed Jan 25, 2017 5:42 pm

newThread filename path restrictions

Post by Nikki »

Hiya,

I'm running into an issue with newThread()
my code base is organised in a way where i have a shared folder with reusable code called lib for many different apps to use:

Code: Select all

root/
  lib/
  all_the_apps/
    app1/
       main.lua
    app2/
    	main.lua

for this to work nicely i just add a

Code: Select all

package.path = package.path .. ";../../?.lua"
Now i have a nicely threaded piece of code that handles my audio system, and I would like to put that piece of code in the 'lib/' folder, but newThread is not having it.
It basically does'nt allow to look for a file that would end up outside, in the parent of the love folder where the main.lua is itself. Basically the limitation of lua filesystem I believe.

anyway, is there something i can do about this ? I don't really wanna have to copy this single file in all the various app folders and keep track of changing all of them in the future.
User avatar
zorg
Party member
Posts: 3435
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: newThread filename path restrictions

Post by zorg »

It's not just newThread, you also can't use .. in require or any of the other new* functions either.
As far as löve is concerned, the filesystem root starts where your project's main.lua is, and anything outside that doesn't exist.

(I'm actually suprised if that package path modification works for you with require)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 18 guests