VFS Path Stylings Idea
- AaronMiller
- Member
- Posts: 81
- Joined: Thu Mar 06, 2008 1:26 pm
- Location: Roseville, California (USA)
- Contact:
VFS Path Stylings Idea
Hullo all. I have an idea, and I was wondering if you wouldn't mind telling me what you think -- it's fairly simple for me to implement at the moment.
Okay, a bit of information first -- I like the Windows FS style (except the backslashes), and I like the Unix FS style. And what I mean by that; Windows: C:\Windows\System32\User32.dll -- Unix (to access the same file): /dev/sda/Windows/System32/User32.dll
I was thinking I could combine the two VFS' in a way that you could use either VFS path name to reference the same file. The idea is that this path name:
C:/Windows/System32/User32.dll
Would be equal to one of these path names:
/mount/sda/Windows/System32/User32.dll -- Note: /mount is where all the mounted devices go in my OS
hd0:/Windows/System32/User32.dll
Basically, what is going on there is that whenever a colon ':' is used, it references one of the mounted file systems in the /mount directory. Like an alias. The 'C:' would basically be an alias of 'hd0' or 'hd1' or whatever.
I got this idea while playing with PlayStation 2 homebrew -- I noticed a path name like this:
mc0:somedir/somefile.ext
I actually liked that a bit, and figured it could be an optional way to reference files in my OS. What do you guys think?
Cheers,
-naota
Okay, a bit of information first -- I like the Windows FS style (except the backslashes), and I like the Unix FS style. And what I mean by that; Windows: C:\Windows\System32\User32.dll -- Unix (to access the same file): /dev/sda/Windows/System32/User32.dll
I was thinking I could combine the two VFS' in a way that you could use either VFS path name to reference the same file. The idea is that this path name:
C:/Windows/System32/User32.dll
Would be equal to one of these path names:
/mount/sda/Windows/System32/User32.dll -- Note: /mount is where all the mounted devices go in my OS
hd0:/Windows/System32/User32.dll
Basically, what is going on there is that whenever a colon ':' is used, it references one of the mounted file systems in the /mount directory. Like an alias. The 'C:' would basically be an alias of 'hd0' or 'hd1' or whatever.
I got this idea while playing with PlayStation 2 homebrew -- I noticed a path name like this:
mc0:somedir/somefile.ext
I actually liked that a bit, and figured it could be an optional way to reference files in my OS. What do you guys think?
Cheers,
-naota
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: VFS Path Stylings Idea
The whole concept of mounting doesn't work with Windows-style paths. What's stopping me from mounting my floppy drive in /mount/sda/Windows/System32/floppy ? If you can only mount in one place then it's Windows-style anyway so you're just replacing "/" with "\"which isn't much of a VFS thing. Actually, even Windows recognizes the "/" character as a separator.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
- AaronMiller
- Member
- Posts: 81
- Joined: Thu Mar 06, 2008 1:26 pm
- Location: Roseville, California (USA)
- Contact:
Re: VFS Path Stylings Idea
No, I didn't mean it like that.
I meant the specialized shortcut. "blarg:/hi.txt"
Cheers,
-naota
I meant the specialized shortcut. "blarg:/hi.txt"
Cheers,
-naota
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: VFS Path Stylings Idea
I know. But I just told you why it wouldn't work. A: can be mounted inside C:.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
- AaronMiller
- Member
- Posts: 81
- Joined: Thu Mar 06, 2008 1:26 pm
- Location: Roseville, California (USA)
- Contact:
Re: VFS Path Stylings Idea
Oh, I see what you mean.
No, that aliasing only takes place in the '/mount' directory. 'A' (fd0) would be a device -- mounted by its own driver to the mount directory -- A is an alias of /mount/fd0 at /mount/A -- A can be changed to be, for example, C:/Floppy
By the design of my own VFS, fd0 can't be deleted -- it doesn't make sense to allow it to be deleted (unmounted, yes.) -- I forgot what relevance that had, but thought I'd share that anyways.
Cheers,
-naota
No, that aliasing only takes place in the '/mount' directory. 'A' (fd0) would be a device -- mounted by its own driver to the mount directory -- A is an alias of /mount/fd0 at /mount/A -- A can be changed to be, for example, C:/Floppy
By the design of my own VFS, fd0 can't be deleted -- it doesn't make sense to allow it to be deleted (unmounted, yes.) -- I forgot what relevance that had, but thought I'd share that anyways.
Cheers,
-naota
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: VFS Path Stylings Idea
Ok, I see what you're driving at. Still, the whole idea of having A: and C: is separating volumes. It'd be sort of odd if you had A:, C: and you could also access A: from within C:. Anyway, I'm no UNIX guru so I'm not entirely sure you can mount something twice.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: VFS Path Stylings Idea
Hi,
The beautiful thing about Unix style mount points is that you can copy all the data from one drive or partition to another drive or partition and mount the new partition where the old partition was, and nobody will notice any difference. In a similar way (for e.g.), if the partition used for "/usr" becomes full you could copy everything in "/usr/src" to a new partition and mount that partition at "/usr/src" to free up space in the original partition.
Using device names (either "A: and C:" or "/dev/fda and /dev/sda") means that as soon as you change devices your symbolic links (or shortcuts?) end up broken, and so do any other file references. For example, a startup script that executes the file "/dev/sda1/sbin/foo" will become broken if the file suddenly becomes "/dev/sdb2/sbin/foo"; and a user/administrator would probably need to manually find all the broken file references and symbolic links and fix them. Note: In earlier versions of Windows this caused plenty of problems - you'd install a new hard drive and suddenly your CD-ROM becomes E: instead of D: and most of your games wouldn't work anymore because the game checks if the official CD is in "drive D:".
Cheers,
Brendan
In Unix I don't think you can mount something twice, but there's probably no technical reason why a (non-Unix) OS couldn't. However, it'd be confusing for users and inefficient for things like backups (for example, if you copy "/" and everything in it somewhere then you'll end up with 2 versions of the exact same data).Love4Boobies wrote:Ok, I see what you're driving at. Still, the whole idea of having A: and C: is separating volumes. It'd be sort of odd if you had A:, C: and you could also access A: from within C:. Anyway, I'm no UNIX guru so I'm not entirely sure you can mount something twice.
The beautiful thing about Unix style mount points is that you can copy all the data from one drive or partition to another drive or partition and mount the new partition where the old partition was, and nobody will notice any difference. In a similar way (for e.g.), if the partition used for "/usr" becomes full you could copy everything in "/usr/src" to a new partition and mount that partition at "/usr/src" to free up space in the original partition.
Using device names (either "A: and C:" or "/dev/fda and /dev/sda") means that as soon as you change devices your symbolic links (or shortcuts?) end up broken, and so do any other file references. For example, a startup script that executes the file "/dev/sda1/sbin/foo" will become broken if the file suddenly becomes "/dev/sdb2/sbin/foo"; and a user/administrator would probably need to manually find all the broken file references and symbolic links and fix them. Note: In earlier versions of Windows this caused plenty of problems - you'd install a new hard drive and suddenly your CD-ROM becomes E: instead of D: and most of your games wouldn't work anymore because the game checks if the official CD is in "drive D:".
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: VFS Path Stylings Idea
You could only allow mount points in the unix style paths so that /mount/sda/Windows/System32/floppy points to /mount/floppy and hd0:/Windows/System32/floppy just points to an empty directory. It would create an inconsistency between the two methods of access but it would make more sense from a logical standpoint.
For this you could use the volume label or a GUID to mount instead, or have a way to allows mount a disk at the same location regardless of its physical connection.Brendan wrote:Using device names (either "A: and C:" or "/dev/fda and /dev/sda") means that as soon as you change devices your symbolic links (or shortcuts?) end up broken, and so do any other file references. For example, a startup script that executes the file "/dev/sda1/sbin/foo" will become broken if the file suddenly becomes "/dev/sdb2/sbin/foo"; and a user/administrator would probably need to manually find all the broken file references and symbolic links and fix them.
Re: VFS Path Stylings Idea
I never tried with a floppy drive, but you're completely free in XP to mount a partition on an empty directory in a NTFS partition.Still, the whole idea of having A: and C: is separating volumes. It'd be sort of odd if you had A:, C: and you could also access A: from within C:.
http://support.microsoft.com/kb/307889
- AaronMiller
- Member
- Posts: 81
- Joined: Thu Mar 06, 2008 1:26 pm
- Location: Roseville, California (USA)
- Contact:
Re: VFS Path Stylings Idea
Let me try and re-explain.
* Nothing is mounted twice -- it can't be mounted twice, only once and thats it.
* If you use ':' it means "To the left of this colon references an alias or directory in the /mount directory"
So "A:/boot/grub/menu.lst" would be "/mount/fd0/boot/grub/menu.lst" -- assuming 'A' is an alias to /mount/fd0 that exists in the /mount directory. Therefor, "A:/boot/grub/menu.lst" is the same as the following:
/mount/A/boot/grub/menu.lst
/mount/fd0/boot/grub/menu.lst
fd0:/boot/grub/menu.lst
Although it's mounted only once. There's no real reason to have an alias in the mount directory other than to get a 'wine' styled app to work, and to allow people switching from Windows (or just familiarizing themselves with this OS) to have an easier time moving over.
It's like a special kind of environment variable. Ex, in Windows the path '%comspec%' would usually reference "C:\Windows\System32\cmd.exe" or "%temp%" would usually reference "C:\Temp" Where as this is simply a way to reference something in the /mount directory without having to type out its full path + it looks cool (IMO.)
Thanks for the input, all.
Cheers,
-naota
* Nothing is mounted twice -- it can't be mounted twice, only once and thats it.
* If you use ':' it means "To the left of this colon references an alias or directory in the /mount directory"
So "A:/boot/grub/menu.lst" would be "/mount/fd0/boot/grub/menu.lst" -- assuming 'A' is an alias to /mount/fd0 that exists in the /mount directory. Therefor, "A:/boot/grub/menu.lst" is the same as the following:
/mount/A/boot/grub/menu.lst
/mount/fd0/boot/grub/menu.lst
fd0:/boot/grub/menu.lst
Although it's mounted only once. There's no real reason to have an alias in the mount directory other than to get a 'wine' styled app to work, and to allow people switching from Windows (or just familiarizing themselves with this OS) to have an easier time moving over.
It's like a special kind of environment variable. Ex, in Windows the path '%comspec%' would usually reference "C:\Windows\System32\cmd.exe" or "%temp%" would usually reference "C:\Temp" Where as this is simply a way to reference something in the /mount directory without having to type out its full path + it looks cool (IMO.)
Thanks for the input, all.
Cheers,
-naota