Question: I have a program that implements an archive and I need to extract files from the created archive. I intend on doing so by creating a new file. I already have the file name/user id/group id/ date/ mode (permissions)/ etc. So how would I create a file with these given attributes?

Answer: 
On creating a File, certain properties are automatically set. This includes the Owner & Time/Date. You can specify the name of the file to be created, but the file is automatically owned by you and inherits your user ID and group ID (i.e.. of the one executing the program) - This is system generated and is done so for security reasons (what if you did not have access to an other user's credentials?). You can however change the owner or group (chown/chgrp) & even change the file permissions (chmod), once the file has been created. If you wish to execute a single command, you can simply append these commands (using ;).
You pretty much need three system calls to accomplish your task:

* [`chmod`](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html) to change permissions.
* [`chown`](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html) to change the ownership (user and/or group).
* [`utime`](http://www.kernel.org/doc/man-pages/online/pages/man2/utime.2.html) to change file last access and modification time.