Author Topic: FileSyst  (Read 21474 times)

0 Members and 3 Guests are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
FileSyst
« on: January 02, 2013, 04:17:46 pm »
Hey everybody, I believe this is my next big project while I take a break from Grammer. In fact, this program used some code from my current progress on GrammerOS, but I will probably end up using this project for GrammerOS later. Anyways, what is it?

FileSyst provides some core routines for handling a filesystem on the TI-83+/84+/SE calculators and in the plans are a full folder system support, along with navigation, naming of the variables, icons, and a slew of other abilities. Currently, progress is in the planning stage. A few days ago I made a program and last night I turned it into an App. I basically took BatLib, hollowed it out except for about 50 BatLib commands, then I inserted what I had done with the program version and it is an undocumented mess at the moment. However, it has this much completed:

-Run the app and select the program to run (this is only for the developers version)
-The program will be executed using the FileSyst parser hook (hooks are restored when the program finishes)
-The dim() token is used to execute the included BatLib routines or the FileSyst routines.
-FileSyst takes arguments as a string. For example, "BASIC(Zeda:Doc Prog)" .
-FileSyst can open folders and files and automatically creates folder/files if you try to access them and they don't exist.
-There are only two commands at the moment:

BASIC() will open a file and try to execute it as a BASIC program
VPTR() will make a shortcut to an OS variable (the var doesn't actually need to exist)

An example might be:
Code: [Select]
dim("VPTR(prgmTEST,Zeda:Doc Test) BASIC(Zeda:Doc Test)
However, once I add in the CD command (which is basically only three bytes of code at this point):
Code: [Select]
dim("CD(Zeda:Doc) VPTR(prgmTEST, Test) BASIC( Test)
Anyways, since the program isn't very presentable, I won't release a program yet. Currently, there are two other projects that are already in the works to use this program-- ScopeOS by Codebender (with help from myself and Roguebantha) and Linux which is being done by Roguebantha (originally using BatLib, but that is why we have included certain BatLib commands in this app).

ScopeOS will hopefully provide a nice GUI to view the files and folders as well as all of the OS variables. I plan to add the following commands shortly:
Code: [Select]
CD(path)         This will open a folder (or use ".." to go up one folder level)
CF(filepath,field,data)     This will change a field in the header data of a file. Fields could be for passwords, descriptions, or specifying what programs to open the file with.
CI(filepath,icon#|icondata) This will change the icon number, or if you supply hex data, it will change the icon to a custom icon.
CN(filepath,newname)            This will change the name of a file.
COMP(filepath)              This will compress a file
COPY(filepath,newpath|newfilepath) This will copy a file from one location to another
DADD()                      Returns a string with the current directory
DEL(path) or DEL(filepath)   This will delete a folder or file.
GETD(path,#)                 Returns info aboutt he nth item in the directory (so you can create a list of variables or whatnot)
HIDE(filepath)              This will mark a file or folder as hidden
LOCK(filepath)              This will mark a file or folder as locked
MOVE(filepath,newpath)       Moves a file to another directory
ND(loc)                     This adds a new directory
SCUT(lfilepath,newloc)       This creates a shortcut of a file.
VPTR(VarName,filepath)      This will create a file that points to an OS variable

It currently supports relative paths where it starts from the current directory and absolute paths where it starts from the main directory. It also allows you to navigate back through directories by using ".." (or navigate back another directory for every additional period).

I wish it looked prettier so that I could supply some cool screenshots, but really, you don't see much happening. I've spent many hours over the past three days working on this working out any potential bugs. I hope the new years brings success because I had a really cool thought about how to use this when I first started.

Say you were making an RPG and you wanted to use a folder to store or retrieve monster data, player data, or anything else like that. You could use this program to make a directory in the main folder (named after your game or something), then in that folder you could put all of the other data you need. Then, to retrieve the data, you can use the FileSyst program to access the data through paths. Since the app has a bunch of graphics and data manipulating commands, I can make commands like SPRITE() so that you can make a script for certain parts of your program.

Here is a screenie from yesterday's version:

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: FileSyst
« Reply #1 on: January 02, 2013, 04:32:48 pm »
Wow, pretty cool! :D
And GrammerOS? :crazy:

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #2 on: January 02, 2013, 04:34:33 pm »
Yes, I have been working on GrammerOS and Grammer3 every no and then, but I have basically taken a break from them (kind of like what I did with BatLib, probably a year from now I will put some serious work into the two).

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #3 on: January 02, 2013, 10:51:29 pm »
The developers version has been uploaded to the Google project page for Scope OS for anybody that wants to try it in WabbitEmu. I doubt it is error free, but you can get an idea of how it works.

Download
Documentation is included, naturally, as well as the mangled source.

I added the GETD() function and CD(). CD() simply changes the default path and GETD() returns a string with information on the files in the given directory, such as the file names, types, and sizes. Now I can play with the included BatLib commands to try to get a simple GUI started :3


If you want the parser hook installed, you have to NOT let the program finish when executing a program from the app(I just press ON or try to run an assembly program).

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #4 on: January 03, 2013, 04:08:31 pm »
This is an update for v1.006! I added the two commands DEL() and GICON() and I fixed the BatLib functions. On top of that, I modified one of the BatLib routines, so now commands like DBRead or GetStats can be performed on OS vars or FileSyst files. There was also an issue with GETD() that I fixed (it crashed when you tried to read an empty folder) and I also made it throw an error if you try to use it on a file instead of a folder. There was a bug with using ".." as well, to navigate back one folder. It was actually more of a really bad coding issue than a bug, but I fixed it.

Download

To expand on the two new commands:
[+] DEL() will delete a folder or file
[+] GICON() will return a 32-byte string containing the file icon. Currently I have two dummy icons, one for folders, the other for every other var type. Folders are an empty box, all the rest are a black square.
I am hoping that some examples can soon be made, but for now you can watch the screenshot below :)
I basically run through these commands in the screenshot:
Code: [Select]
dim("GETD()
dim("CD(ZEDA)
dim("GETD()
dim("GETD(ZEDA)
dim("CD(ZEDA:DOC) CD(..:PROG) GETD(..)
dim("VPTR(prgmA,ZEDA:PROG PROGGY)
dim(8,"EA
dim(8,"(ZEDA:PROG PROGGY)
dim("GICON(ZEDA:PROG PROGGY)
dim("GICON(ZEDA)
dim(22.1,dim("GICON(ZEDA:PROG PROGGY)"),16,1,1,0,99
dim("CD(ZEDA) DEL(:DOC) GETD()
dim("DEL()
Note that dim(8) returns the contents of the variable and dim(22) draws a sprite

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #5 on: January 04, 2013, 10:43:56 am »
Since the last post, I have done the following

  • Added CI() to change the file icon (either to a preset icon of which there are currently two dummy ones, or a custom icon).
  • Strings passed to FileSyst have lowercase letter tokens converted to ASCII
  • Strings passed from FileSyst have lowercase letter ASCII converted to tokens
  • There was an issue in BatLib where referencing Ans as a variable wasn't working. Since FileSyst uses a bunch of BatLib routines, this issue was carried over, but it is fixed now (and it will be fixed in the next BatLib release).
  • Added key debouncing before executing a program from the app.
  • Added CN() which lets you change a file name
  • Added HIDE()
  • Added LOCK()
  • I modified the parser to be able to read program files and handle Newlines separating commands >.>

My To Do list looks like this currently:
  • Add CDIR() (so that you can get a string with the current directory name).
  • Add COPY() command
  • Add MOVE() command
  • Add COMP() command (this will compress a file or folder)
  • Add SCUT() command to create shortcuts
  • Add OPEN() command
  • Add CF() command to Change a Field in the header
  • Add SPRITE() command
  • Add in the ability to store/recall strings or numbers from in the FileSyst parser
  • Add IF statements and some other similar commands
  • Let BASIC() have an argument to specify the name of the tempprog to use.
  • GETD() should read Groups, too (use GroupRead)


I also have in the plans:
  • Add a command to run programs using the FileSyst parser
  • Add in file associations as Field 0

For the file associations, here is an example. Say you had an ION program. If you use VPTR() to create an OS shortcut, you can then change Field 0 to include the phrase 'ION'. When you try to use OPEN() on the file, FileSyst will try to open DoorsCS7, MirageOS, ION, or NoShell to run the program (these are the default associations for ION programs). There will also be an external appvar that holds data from other installed programs. For example, if a program is made in the future for a text editor or image editor, they can edit the appvar to associate certain file types with the program.

Attached is version 1.010 for anybody that wants to play around with it.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #6 on: January 04, 2013, 10:20:04 pm »
Filesyst v1.013 is ready for download. I changed CDIR() to PWD() by a suggestion from Roguebantha. So I have added PWD(), COPY(), and CFT() (change filt type). CP() is accepted as a substitute for COPY(), too.

COPY() doesn't copy the header of the file, so I plan to fix that tomorrow. All this means for now is that icon information isn't preserved when copying.

EDIT: FileSyst can now create folders and files, navigate through folders, and copy files/folders, so I think that means it has the basics for file management :3
I fixed COPY() to copy the file header and I am now working on CF() to change a field. For example, Field 0 will be for file associations, Field 1 will probably be for comments. So if I want to change the comment of file Hi:
Code: [Select]
CF(Zeda:Prog Hi,1,'This is a Hello World program.')
Which reminds me, I changed string inputs to require single quotation marks

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #7 on: January 05, 2013, 07:07:04 pm »
FileSyst v1.017 has been uploaded. It now supports use of inline code in BASIC programs and you can store intermediate results to OS strings. I added CF(), GETF(), FDEL(), and AFA() (stands for Add File Association) today as well. Again, I'm hoping to get an example program sometime, but seriously, you can access a file system in BASIC now :D I plan to eventually add support for accessing Group variables as a special type of folder, so think of how cool that could be o.o You could make an RPG and create a folder for it and access all of the group data as part of the folder.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #8 on: January 06, 2013, 09:15:08 am »
Luckily nobody tried last nights version >.> After putting it on my calc and relinquishing my internets, I discovered that the documentation I provided for the order of the Extended BASIC commands was wrong and that they did not work if they had >1 argument x.x

The good news: The FileSyst commands still worked and I started to design a simple command prompt like thing :D The whole prompt thingy is written in BASIC and the shifting of the screen is an Assembly program from my B4001 contest entry (all it does is shift the lower 49 pixels up 6 pixels, so it preserves the top 9 rows). Sorry for the really long screenie, I kept forgetting that to delete files, you need to have an extra space >.>

EDIT: I uploaded a version that would freeze your calculator (some debugging code) .___. Sorry to the person that downloaded the app !_! Here is a fixed version (again) Hopefully I got it right this time.

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: FileSyst
« Reply #9 on: January 06, 2013, 11:41:32 am »
ooh, that's really fancy =)
how long have those other OSs you mentioned been worked on? i don't see much about scope os on the project page there

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #10 on: January 06, 2013, 11:48:23 am »
Thanks! Now that I have the eBASIC commands fixed, I can probably make faster/fancier (I hope).
how long have those other OSs you mentioned been worked on? i don't see much about scope os on the project page there
ScopeOS has been worked on for about a month, though I've seen no code, screenshots, or examples of it XD The Linux OS one I have seen some pretty cool screenshots of:

I'm assuming he won't mind me posting a screenshot >.>
Linux OS
Scope OS I <--That quickly degenerated into FileSyst conversation

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: FileSyst
« Reply #11 on: January 06, 2013, 02:46:22 pm »
wow, pretty cool!
And how did you get the screenie scaled up like that O.o

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #12 on: January 06, 2013, 03:18:41 pm »
I'm not sure what he used :/

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: FileSyst
« Reply #13 on: January 06, 2013, 03:52:49 pm »
It's probably TilEm (2). You can pick several sizes as well as the colors to use. The default color is that bright white (and a rather large resolution).

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: FileSyst
« Reply #14 on: January 06, 2013, 11:50:45 pm »
I added more to the command-prompt interface that I made and I finally fixed up the bugs that I introduced in some of my tests today. Now the "working directory" is saved to an external file and kept track of. This means that when you do CD() in one code block, the effect remains, even after the program is finished. This makes file navigation in BASIC much easier. Attached is a screenie and download