brucefight 发表于 2013-2-1 11:23:52

c file file s

#include <sys/types.h>
#include <unistd.h>
#include <limits.h>
#include <sys/stat.h>

int main(int argc,char *argv[])
{
    char path;
    char file;
    if(argc!=2)
    {
printf("Usage:mk<pathname>\n");
return 1;
    }
    getpwd(path);
    printf("current directory is :%s\n",path);
    if(mkdir(argv,S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH)<0)
    {
printf("mkdir failed \n");
      return 2;
    }
    if(chdir(argv)<0)
    {
      printf("chdir failed \n");
      return 3;
    }
    getpwd(path);
    printf("mkdir successful \n New current directory is :%s\n",path);
    /*
    rmdir(path);
    */
    return 0;
}
页: [1]
查看完整版本: c file file s