jaynabonne wrote:As far as simulating a file system goes, the approach you'd take depends on what you want to do. If you want to have dynamic creation, then you can't use static data - so what will you create? If you want to associate file data with file names, then you could use a general purpose dictionary (*not* a string dictionary). Then you can have keys point both to strings (text file data?) and other dictionaries to model nested subdirectories.
But if you want to remember more than just file contents, then you could go whole hog and use an object per file/directory entry, with child objects corresponding to children in a subdirectory.
I might take a stab at this, since it sounds simple enough and could be fun...
Edit: Since you mentioned "dir" instead of "ls", I assume you're looking to a Windows command prompt sort of thing instead of Linux...
Logged in.
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\
> mkdir foo
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\
<DIR> foo
> cd foo
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\foo
<DIR> .
<DIR> ..
> cd ..
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\
<DIR> foo
> mkdir foo
A subdirectory or file foo already exists.
> mkdir foo2
> cd foo2
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\foo2
<DIR> .
<DIR> ..
> mkdir foo3
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\foo2
<DIR> .
<DIR> ..
<DIR> foo3
> cd ..
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\
<DIR> foo
<DIR> foo2
> cd foo
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\foo
<DIR> .
<DIR> ..
> cd ..
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\
<DIR> foo
<DIR> foo2
> rmdir foo
> dir
Volume in drive C has no label.
Volume Serial Number is 3141-5192.
Directory of C:\
<DIR> foo2
> cd
C:\
> cd foo2
> cd
C:\foo2
>
jaynabonne wrote:No, you need to do those yourself. It will only set the font and color for the elements in the type-in area. (Sorry I wasn't clear.)