include "inc/cmdsys.plh"
include "inc/args.plh"
include "inc/fileio.plh"

var arg
char[64] filename
res[t_fileinfo] fileinfo
//
// Check arguments and file types
//
arg = argNext(argFirst)
if ^arg
    strcpy(@filename, arg)
    if fileio:getfileinfo(@filename, @fileinfo) == FILE_ERR_OK
        puts("File exists: "); puts(@filename); putln
    else
        if fileio:create(@filename, $0F, $0000) <> FILE_ERR_OK
            puts("Unable to create directory: "); puts(@filename); putln
        fin
    fin
    return
fin
puts("Usage: +NEWDIR PATH\n")
done
