Question:
If one types something like "mkdir a/include/the" in the root directory
and the directory "a" does not exist yet, should our mkdir function create
all three directories? That is, create "a" in "/", "include" in "a", and
"the" in "include" ?
or...does the directory "a" have to exist in order for the command to be
valid?
And, similarly, if one invokes mkfile in the root directory as: "mkfile
a/include/the", should our mkfile function create a directory called "a",
make another directory called "include" inside "a" and then make a file
called "the" inside include?
Any help would be appreciated.
Thanks
If the directory does not exist then it has to be created. For
example, if the user types "mkdir /a/include" and directory "a" does not
exist, then directory "a" has to be created and directory "include" should
be placed within directory "a". As far as I believe there is no way to
create a directory using mkfile. Hope that helps.
Mohammed
But...what about mkfile? Right now, I've set my mkfile so that it only
allows the user to create files in existing directories. I think that
makes sense because the purpose of mkfile is to make files, not to make
directories.
What do others think?
Any feedback would be appreciated.
Thanks!
I thought we were building our file structure according to unix and that
if you type a\bin and a does not exist then you can't create and you get
an error message, And I also agree with Masood, mkfile is only for
creating files not directories, just like in unix
Can a TA please verify this. Thanks
Ritwik
Kenny
Names like "ls" and "pwd" do kinda suggest a unix-like system, but
I don't really want to assume anything since it isn't explicitly stated in
the handout.
This is something a TA or prof should definitely clarify.
You can assume that only one new element (file or directory) will be
created in one command, if more than one, just output error message.
On
Sun, 17 Nov 2002, Masood Sayam wrote: