This is the mail archive of the
cygwin
mailing list for the Cygwin project.
futimes fails on file open for read
- From: Yitzchak Scott-Thoennes <sthoenna at efn dot org>
- To: cygwin at cygwin dot com
- Date: Sun, 6 Nov 2005 23:34:36 -0800
- Subject: futimes fails on file open for read
The following gives:
futimes returned: -1 (Permission denied)
I'm told it succeeds on linux; is it even possible for it to work on
cygwin or am I SOL?
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
int main(int argc,char **argv)
{
int fd, ret;
struct timeval tv[2] = {{500000000, 0}, {500000000, 0}};
if (system("touch foo") == -1) return 1;
if ((fd = open("foo", O_RDONLY)) == -1) return 1;
errno = 0;
ret = futimes(fd, tv);
printf("futimes returned: %d (%s)\n", ret, strerror(errno));
return 0;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/