Hello,
Using stat() you can retreive information about a file, is there a similar function to or way to set the values? If you modify a value in the stat structure that you populate, can you write it back to the file?
Hello,
Using stat() you can retreive information about a file, is there a similar function to or way to set the values? If you modify a value in the stat structure that you populate, can you write it back to the file?
Well there are specific API calls like chmod / chown to update specific things, but there isn't a single API to allow you to change things arbitrarily.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
if you want to modify the access/modify times, you can try the utime() function.
Thanks Ill take a look at utime()!