Solved [Solved] C: Changing a file's attributes

cenu

Member


Messages: 32

Hello, I've been making some significant progress with my program for writing encrypted file archives. But I'm having a bit of trouble. I don't know how to change a file's attributes once it's been created, i.e. modification timestamp, UID, GID, mode, and size.) This part is extremely crucial for the file extraction process. Even redirection to 'man 2' or 'man 3' pages will be of great assistance.

Thanks in advance.
 
OP
OP
cenu

cenu

Member


Messages: 32

Re: C: Changing a file's attributes

bsdkeith said:
I think you are looking for chmod
Code:
man chmod
http://www.computerhope.com/unix/uchmod.htm
No, you misunderstood.
I'm looking for functions and/or system calls in the standard C Library, not shell commands.
Stuff like
Code:
man 2 chmod && man 2 chown
(found)
But I stilll need something to change the modification timestamp.
 

deflected

Member

Reaction score: 2
Messages: 24

Re: C: Changing a file's attributes

Try with:
Code:
man 2 stat && man 2 utimes
:beergrin
 
OP
OP
cenu

cenu

Member


Messages: 32

Re: C: Changing a file's attributes

deflected said:
Try with:
Code:
man 2 stat
:beergrin
Thanks. It's through that command that I was able to find the
Code:
utimes
system call will help.
This thread will be marked as solved.
 
Top