文件目录操作编程 实现“ls -l“功能

  • Post author:
  • Post category:其他


#include<stdio.h>

#include <sys/types.h>

#include <sys/stat.h>

#include <unistd.h>

#include <dirent.h>

#include<stdlib.h>

#include<error.h>

#include<stddef.h>

#include<string.h>

#include <pwd.h>

#include <grp.h>

#define error_s(error) \



{\



perror(“error”);\



exit(-1);}

int

main (int argc, char *argv[])

{



DIR *dp;



struct dirent *ep;



struct stat st;



char dirp[500]=”/mnt/hgfs/xv/”;



int len=strlen(di



版权声明:本文为vivo133原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。