0

My own tar file can currently use the 'c' and 't' commands correctly (creating he archive, reading the archive), but I'm completely unaware of how to implement 'x' (extracting the archive).

Using C code, how can I recreate a directory / file? I know I can successfully read what is in my .tar file, I'm just not sure of the C function that is used to create directores / files.

NOTE: I've asked multiple people, they couldn't help me. Googled the problem for an hour, but the question is vague enough that I got about 10000 websites answering a different problem.

3
  • 4
    mkdir() to create a directory. If you can create the archive then you already know how to create a file. Commented Feb 23, 2012 at 18:30
  • You mean like mkdir, open or creat? Commented Feb 23, 2012 at 18:32
  • Check out this question for creating files: stackoverflow.com/questions/2395465/… Commented Feb 23, 2012 at 18:32

2 Answers 2

1

Use fopen to create a file (and write to it); use mkdir to create a directory.

Sign up to request clarification or add additional context in comments.

Comments

0

on unix systems ,you'd use mkdir()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.