Omnimaga
Omnimaga => Our Projects => Ndless => Topic started by: gudenau on September 10, 2013, 08:31:05 pm
-
I would like to create a virtual directory in the root of the file explored on the cx, how would I go about doing this in c?
-
To create a directory:
mkdir("/dirname", 0755);
Also, welcome to Omnimaga, and be sure to Introduce yourself (http://www.omnimaga.org/index.php?board=10.0). :)
-
To create a directory:
mkdir("/dirname", 0755);
Also, welcome to Omnimaga, and be sure to Introduce yourself (http://www.omnimaga.org/index.php?board=10.0). :)
Could I then tell the os that there are files there when there are not, then have it do stuff when I/O is preformed on them?
-
I don't understand, what exactly do you mean by "virtual directory"?
The code I gave simply creates a regular directory in the root of the filesystem (which cannot be seen from the document browser).
-
I don't understand, what exactly do you mean by "virtual directory"?
The code I gave simply creates a regular directory in the root of the filesystem (which cannot be seen from the document browser).
What I want is to have a directory at the root of the file system that is not there, the os just thinks it is there and can use it as if it where not there, so when it reads and writes to that location a program on the calculator can then interpret it and do things based on the io that is being preformed. In the end I hope to have removable storage, as I have yet to see this on the nspire.
-
Do you mean like a temporary directory?
-
So kinda like Linux's /dev ? That'd be interesting. :)
-
Rather a filesystem in userspace, or something along those lines, judging by "a program on the calculator can then interpret it and do things based on the io that is being preformed".
-
Street, do you mean /media?
Isn't /dev where the information for /media is stored?
-
His reference to mass storage also makes me think of mount points.
-
So maybe trying to use external storage or another Nspire for storage? Sound interesting... I'll look and see how it's done (code wise) in linux.
-
Yah, basically mount points. Thanks for reminding me of the term.
-
Because the TI-Nspire OS is bases on the Nucleus RTOS, you should look if you can find some info regarding filesystem implementations on Nucleus. According to Wikipedia, it has a "Virtual file system Application programming interface", which is just what you need I think.
Edit: AFAICT, the Datalight Reliance filesystem that is being used on the TI-Nspire uses this API. So in theory you might be able to reverse engineer how this API works out of the OS. But I think I don't need to say that that's going to be a hard and complex task.
AFAIK, at the moment there is no easy way to do what you want. Maybe it would even be easier to patch the functions that are used to open files.
-
Well, maybe if I get this going I should get it into ndless itself.