-1

I'm making a utility in C under Unix. What functions would allow me to:

a) make a directory

b) copy a file into it

Can someone let me know what would work here or point me towards some documentation?

countofmontecristo
  • 381
  • 3
  • 5
  • 15
  • If the only thing your utility will do is those two operations it would be significantly easier to write it in /bin/sh. – perh Nov 02 '14 at 23:07

1 Answers1

0

a) make a directory

The mkdir library method

b) copy a file into it

The fopen, fread, fwrite and fclose methods.

... point me towards some documentation?

The first place to look is section 3 of the online manual; e.g. man 3 mkdir.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • How would I go about naming a sub directory named after its time of creation? Say I have the time ready in a string. – countofmontecristo Nov 02 '14 at 23:17
  • Do you know how to format or concatenate strings in C? (Lookup `sprintf`, `strncpy`, `strncat`, etcetera ... or get a C textbook and read the chapters on string manipulation.) Form the pathname for the subdirectory using those techniques. – Stephen C Nov 02 '14 at 23:22