Closed rustyoz closed 12 years ago
i've figured out a method to reduce the time to print the prompt when a directory change hasn't been made. but that will be for another day, so i wouldn't suggest merging it just yet.
I like what you have in mind here but I think I'm going to take it in a slightly different direction. I'm trying to keep all of the higher level functions in AtlasShell and just have the low level filesystem functions in the OS. That said I'm going to add a new function filesystem_getdirectory in the OS and just parse backwards through the directory stack in the shell getting the directory for each ID stored in the stack via filesystem_getdirectory.
As for efficiency, I know that getfile and getdirectory are quite slow since it has to go through every entry. But this is a very lightweight filesystem and doesn't have balanced tree structure for the files and folders. That will come later possibly. Depends on if we keep a custom filesystem or go with HAT or FAT12.
i like your rework of my filesystem_current subroutine. I was going to put the loading of the pwd name in the cd function, so that only when the pwd directory is change does it scan the table for its name, and load it into the pwd name string. the shell only needs to print out that string each time and not worry about finding it again
tested it out, seems pretty quick, so i guess it won't be a noticeable problem
...y name string.
Prompt prints current directory ... after a noticeable wait, working on that