Advertisement
cd62131

MakeDirectory

Jul 27th, 2014
793
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <sys/stat.h>
  3. #include <time.h>
  4. int main(void) {
  5.   char s[BUFSIZ];
  6.   time_t today_time = time(NULL);
  7.   struct tm *today = localtime(&today_time);
  8.   strftime(s, BUFSIZ, "data%Y%m%d", today);
  9.   mkdir(s, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH);
  10.   return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement