MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / set_date

Function set_date

src/setdate.c:49–63  ·  view source on GitHub ↗

* set_date - Set the file's date and time * @pathname: Path and name of the file to alter * @actime: Date and time to set * @modtime: Date and time to set * * Give a file a particular date and time. * * Return: 0 Success, set the file's date and time * -1 Error, failed to change the file's date and time */

Source from the content-addressed store, hash-verified

47 * -1 Error, failed to change the file's date and time
48 */
49int set_date(const char *pathname, time_t actime, time_t modtime)
50{
51#ifdef HAVE_UTIME
52 struct utimbuf ut;
53 if (!pathname)
54 return -1;
55 ut.actime = actime;
56 ut.modtime = modtime;
57 if (utime(pathname, &ut)) {
58 log_error("ERROR: Couldn't set the file's date and time for %s\n", pathname);
59 return -1;
60 }
61#endif
62 return 0;
63}

Callers 11

reiser_copyFunction · 0.85
file_rename_docFunction · 0.85
copy_dirFunction · 0.85
file_finish_auxFunction · 0.85
ext2_copyFunction · 0.85
undelete_fileFunction · 0.85
exfat_copyFunction · 0.85
ntfs_copyFunction · 0.85
fat_copy_fileFunction · 0.85
fat_copyFunction · 0.85
jpg_save_thumbnailFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected