This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Liraal's profile picture

shell.resolve or the like from within an API

Started by Liraal, 18 March 2012 - 11:52 AM
Liraal #1
Posted 18 March 2012 - 12:52 PM
So i am writing a config file manager function for my API, but there seems to be no way of getting the relative path for a file other than shell.resolve, which doesn't seem to work for APIs. Any ideas?
natedogith1 #2
Posted 18 March 2012 - 12:55 PM
shell.resolve should work in an api
you could always write your own resolver
Liraal #3
Posted 18 March 2012 - 12:57 PM
i am pretty sure it does not.
And right now I am too busy with bug fixes :D/>/>
natedogith1 #4
Posted 18 March 2012 - 01:04 PM
you're calling shell.resolve in a function, right? _G[shell] doesn't get set until shell is run. which happens after all the APIs are loaded
Liraal #5
Posted 18 March 2012 - 01:15 PM
but i am loading the OS and them manually calling loadAPI. What's more, it works when i call it like a program and not an API.
natedogith1 #6
Posted 18 March 2012 - 01:20 PM
I just realized something, there should be no reason to use shell.resolve in an API, so why do you need to use it in an API?
Liraal #7
Posted 18 March 2012 - 01:21 PM
i am writing a config file manager function for my API
natedogith1 #8
Posted 18 March 2012 - 01:39 PM
if it's an API the program using the API should be the thing resolving the paths
Liraal #9
Posted 18 March 2012 - 02:09 PM
I guess I will just make do for now with absolute path and dump everything into root folder.