fs 0x0 on drive0 is my latest project. It is a tiny file system I have created that allows me to write to a drive from a terminal. Normally you would have to use a program to write to a drive, but my code is tiny, so I can write to it from any program.
The first thing I do is to create a folder named.fsc with the name of the directory I’ve created so that I can easily create folders that contain files. I then use the path command to get it to work.
The path command is basically a shell command that lets you create a file path, so you can say something like “the path/to/file” or “the path/that/file” and it will create the file in the directory you specify.
I then use the chdir command to get the current directory (to create a folder called mydirectory) and then use the mkdir command to create the folder in the directory I just created. I then use the mkdir command again to create a folder that contains the file. The path command is one of those little shell commands that I use when I can’t find anything else in my shell to do what I want.
This is a good one. My girlfriend and I were talking about how we used to use it to name folders in Unix to make sure they were in the same folder so when something was moved or deleted we were in the same place. I guess it’s a useful function. It also works great for creating a subdirectory, too. So say you want to create a folder called mydirectory in the current directory. The command is mkdir mydirectory.
It’s great to have a command that will work in the command shell that will do just about anything you can imagine.
This isn’t the first time I’ve seen a directory name that used an 8-bit character, so you can imagine what my surprise was when I saw this. But how does it work? Well, in the command shell, it simply replaces the character with the value of a variable. So for example, when you type cd mydirectory I’d type cd mydirectory. Or you could use the command cd mydirectory | grep something.
Now this command will only replace any characters in a directory with the corresponding value, so you could use this to replace a directory name with the string “hello” or any other string.
Since the command shell is executed in a text editor (or command shell) you can also use sed or awk to change a regular expression that matches a path name to any string.
As a quick aside, you can use sed or awk to add some path information to a command. For example, if you want to move a file from a directory that is not in $PATH then you can do sed -i. With the -i option, the sed command will replace all occurences of a string with the string. This is useful for moving or adding files to a directory.