#include <captive/client-file.h>
#include <sys/stat.h>
#include <captive/macros.h>
+#include <time.h>
#include "op_utime.h" /* self */
#include "main.h"
file_info.valid_fields=0
|GNOME_VFS_FILE_INFO_FIELDS_ATIME
- |GNOME_VFS_FILE_INFO_FIELDS_MTIME;
+ |GNOME_VFS_FILE_INFO_FIELDS_MTIME
+ |GNOME_VFS_FILE_INFO_FIELDS_CTIME;
file_info.atime=buf->actime;
file_info.mtime=buf->modtime;
- /* It is probably not GnomeVFS compliant but still libcaptive compatible.
- * GnomeVFS looks as assuming all the three fields set.
- * GnomeVFS also does not check 'valid_fields' at all.
+ file_info.ctime=time(NULL);
+ /* Do not: * It is probably not GnomeVFS compliant but still libcaptive compatible.
+ * * GnomeVFS looks as assuming all the three fields set.
+ * * GnomeVFS also does not check 'valid_fields' at all.
+ * file_info.ctime=0; * Just sanity for sure. *
+ * file_info.valid_fields&=~GNOME_VFS_FILE_INFO_FIELDS_CTIME;
+ * as utime() syscall should really update 'ctime' to the current time.
*/
- file_info.ctime=0; /* Just sanity for sure. */
errvfsresult=captive_file_file_info_set(captive_file_object,&file_info,GNOME_VFS_SET_FILE_INFO_TIME);
g_object_unref(captive_file_object);