attr2 = strchr (attr, ':');
if (attr2)
{
- attr2++; /* Skip ':' */
+ attr2 += 2; /* Skip '::' */
unescaped_attribute = hex_unescape_string (attr2, NULL, &free_unescaped_attribute);
if (user)
a = g_strconcat ("user.", unescaped_attribute, NULL);
#endif
parent_info->owner = statbuf.st_uid;
parent_info->device = statbuf.st_dev;
- /* No need to find trash dir if its not writable anyway */
+ /* No need to find trash dir if it's not writable anyway */
if (parent_info->writable &&
g_file_attribute_matcher_matches (attribute_matcher, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH))
parent_info->has_trash_dir = _g_local_file_has_trash_dir (dir, statbuf.st_dev);
#endif
#if defined (HAVE_STRUCT_STAT_ST_BLOCKS)
g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_UNIX_BLOCKS, statbuf->st_blocks);
+ g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE,
+ statbuf->st_blocks * G_GUINT64_CONSTANT (512));
#endif
g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED, statbuf->st_mtime);
if (basename != NULL && basename[0] == '.')
g_file_info_set_is_hidden (info, TRUE);
- if (basename != NULL && basename[strlen (basename) -1] == '~')
+ if (basename != NULL && basename[strlen (basename) -1] == '~' &&
+ S_ISREG (statbuf.st_mode))
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_STANDARD_IS_BACKUP, TRUE);
#else
if (dos_attributes & FILE_ATTRIBUTE_HIDDEN)
}
GFileInfo *
-_g_local_file_info_get_from_fd (int fd,
- char *attributes,
- GError **error)
+_g_local_file_info_get_from_fd (int fd,
+ const char *attributes,
+ GError **error)
{
GLocalFileStat stat_buf;
GFileAttributeMatcher *matcher;
g_set_error (error, G_IO_ERROR,
g_io_error_from_errno (errsv),
- _("Error setting owner: %s"),
+ _("Error setting modification or access time: %s"),
g_strerror (errsv));
return FALSE;
}
#ifdef HAVE_UTIMES
GFileAttributeValue *mtime, *mtime_usec, *atime, *atime_usec;
#endif
-#if defined (HAVE_CHOWN) && defined (HAVE_UTIMES)
+#if defined (HAVE_CHOWN) || defined (HAVE_UTIMES)
GFileAttributeStatus status;
#endif
gboolean res;