Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!emory!hubcap!ncrcae!sauron!wescott From: wescott@Columbia.NCR.COM (Mike Wescott) Newsgroups: comp.sys.ncr Subject: Re: mkdir() Message-ID: <1879@sauron.Columbia.NCR.COM> Date: 9 Jan 90 15:28:42 GMT References: <5849@uhccux.uhcc.hawaii.edu> <25350001@hpisod2.HP.COM> <6045@uhccux.uhcc.hawaii.edu> Sender: news@sauron.Columbia.NCR.COM Reply-To: wescott@micky.Columbia.NCR.COM (Mike Wescott) Organization: E&M-Columbia, NCR Corp, W Columbia, SC Lines: 38 In article <6045@uhccux.uhcc.hawaii.edu> bt455s10@uhccux.UUCP (Carl "Art" McIntosh) writes: > NO, the mkdir() function is *completely* undocumented in OS 2.01.00, > furthermore, it is broken [...] > main() > { > if (mkdir("art") == -1) > printf("%d\n", errno); > } > use mkdir(1) to create an "art" directory before running the program. > The output from the above program is "25", which corresponds to > ENOTTY (Not a typerwriter) in /usr/include/sys/errno.h. mkdir.o is indeed broken in that it does not completely emulate the system call of the same name in 4.3BSD and later vintages of SysV. The Rel2.xx version of mkdir is an emulation using a popen() to the shell and feeding it a mkdir and chmod. The ENOTTY errno is often found in errno when stdio is used (as it is here with the popen()). The supplied mkdir() takes two arguments: the name of the directory to make and the mode. Taking all this into account: main() { if (mkdir("art",0755) != 0) printf("could not mkdir %s\n","art"); } If you expect full mkdir capability or none (like perl) you can't use it. Why it's not documented, I don't know. Probably because it wasn't supposed to be released. -- -Mike Wescott mike.wescott@ncrcae.Columbia.NCR.COM