GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
ELFTC_SET_TIMESTAMPS(3) FreeBSD Library Functions Manual ELFTC_SET_TIMESTAMPS(3)

elftc_set_timestamps
set file timestamps

library “libelftc”

#include <libelftc.h>

int
elftc_set_timestamps(const char *filename, struct stat *sb);

The elftc_set_timestamps() function is used to set the access and modified time stamps on a file based on the contents of a struct stat descriptor.

Argument filename names an existing file in the file system.

Argument sb points to structure of type struct stat populated by a prior call to fstat(2) or stat(2).

This function will invoke the high-resolution utimes(2) system call if the underlying operating system supports it. On operating systems lacking support for utimes(2), the function will use lower resolution utime(2) system call.

To set the access and modified times for a new file to those of an existing file, use:
struct stat sb;
const char *existing_filename, *new_filename;

if (stat(existing_filename, &sb) < 0)
	err(EXIT_FAILURE, "stat failed");

if (elftc_set_timestamps(new_filename, &sb) < 0)
	err(EXIT_FAILURE, "timestamps could not be set");

fstat(2), stat(2), utime(2), utimes(2)
December 15, 2011 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.