I need help with some C code

DaiShan

Diamond Member
Jul 5, 2001
9,617
1
0
So what I'm trying to do is create a folder in each users home directory that appears in a list in my home directory that is based on the date. I gave up on trying to figure out the date function in C so what I was planning on doing was piping the output from date into my program " $ date | dirmake" but I've really confused the issue it seems. Here is what I have with commnents for what I would like to do. Does anyone have any insight? The code is here. Thanks in advance
 

oog

Golden Member
Feb 14, 2002
1,721
0
0
don't you want date to be a char * and set it to argv[1]? also, can't you do something like mkdir `date +%F`?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Yes, you'll have a much easier time with either shell scripting or something like perl or python.
 

DaiShan

Diamond Member
Jul 5, 2001
9,617
1
0
I'd originally wanted to create it in C because I had a fair idea of how I wanted to do it. As you could see I quickly started going down a slippery slope, so I thought about how I would do it at the command line and created (as suggested) a (very) short bash script to do the job. For those that are interested the code is at http://www.nomorepasting.com/paste.php?pasteID=55398