[comp.lang.c] Directories in C

cs348cw@ibma0.cs.uiuc.edu (nesha nicole jones) (02/12/91)

I was wondering if any one knew if you could read in a variable in C 
and check to see if it is a directory.  If if is I would like to make it a 
directory.  I know how to check to see if something is a file, however,
I could not find anything specifically related to directories.  I know
how to make a directory using shell. but I can't seem to pass the variable
I read using scanf to the system( mkdir ___) command.


Advise would be appreciated.


Nesha 

fischer@iesd.auc.dk (Lars P. Fischer) (02/13/91)

>>>>> On 12 Feb 91, cs348cw@ibma0.cs.uiuc.edu (nesha nicole jones) said:

Nesha> I was wondering if any one knew if you could read in a variable
Nesha> in C and check to see if it is a directory. ...

It would help if you said what type of system you are using, type of
OS, etc. Is this under DOS, VMS, UNIX? If UNIX, is it BSD, SysV, ...?

On a Unix system, try

	man stat
	man 2 mkdir
	man opendir

Some of these might or might not be present. You might also like to
check out a good textbook.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | Beauty is a French phonetic corruption
CS Dept., Univ. of Aalborg, DENMARK. |                   - FZ