Re: rm, mv question

From: Andy Valencia <>
Date: Sun Jan 02 2005 - 10:58:35 PST

greg scott <> wrote:
> Q1. once you've created a dir or file, is there any way to do "rmdir" or
> "rm" respectively, or change the name like "mv"?

Nope, there's no freelist, thus no place to put the "removed" stuff.
I might add a way to flag something unused, and have "ls" not show it.
And then even later I might add a "compact" operation to scrunch
everything downward and harvest all the unused space onto the end of
the directory. But, frankly, my current software project hasn't caused
me to need to do this, thus I haven't taken time to code it up.

> looking at src/filesystem and your webpage "ForthOS filesystem", i
> think this question may off base. assuming the allocated sizes cant be
> changed, i wonder if there is a rename function.

Rename would be much easier... in fact, a really good project if you wanted
to try your hand at modifying ForthOS. :->

> Q2. is the following way to open a file correct?
> looking for a "rename" string in src/filesys, i did this:
> " filesys v"
> "/rename"
> the counter at the upper left of the screen spun for so long i thought
> maybe this isnt the right way to open a file. the final number was
> just over 21000. what is this number?

Remember that once the filesystem is done coughing up an answer, you're back
to blocks. So when you search forward, the editor is quite happy to grind its
way through all the blocks which follow. Hit ESC to make it stop. BTW, this
is also the "grep" function; just the lowest block number'ed file
in a directory, then tell the editor to search for the string you want. It'll
rip through all the files in a row until it finds that block.

> also, "1G" did not work after the search stopped (gave "Corrupt
> block??"), though re-opening the file, going down a few lines, then
> "1G" did work.

Hmmm, I'm guess that somehow you landed on a non-filesystem block. 1G
uses the filesystem meta-information, so if you're on a non-filesystem block
it'll abort when it realizes that there's no filesystem underneath.

> Q3. how do you determine the line number you are on in a file?
> Zs shows cursor position on a screen, but i wanted to know how far
> down in the file i was.

I guess Zs could be taught to calculate and display this... I'd never
run into a need for it. When moving around a file, usually marks and
jumps are much easier.

> have to agree with Phil Howlett: ForthOS is fun!

Thanks! You have to remember that ForthOS is actually just a side
aspect of the software I'm cooking, thus it is going to be a weird
blend of the very practical (because it's actually USED day to day)
and the surprisingly absent (because I haven't happened to have hit
the need for X).

Received on 2 Jan 2005 18:58:35 GMT

This archive was generated by hypermail 2.1.8 : Tue Sep 26 2006 - 09:03:03 PDT