struct exfat_iterator it;
int rc;
char name[EXFAT_UTF8_NAME_BUFFER_MAX];
+ struct stat stbuf;
exfat_debug("[%s] %s", __func__, path);
exfat_debug("[%s] %s: %s, %"PRId64" bytes, cluster 0x%x", __func__,
name, node->is_contiguous ? "contiguous" : "fragmented",
node->size, node->start_cluster);
- filler(buffer, name, NULL, 0);
+ exfat_stat(&ef, node, &stbuf);
+ filler(buffer, name, &stbuf, 0);
exfat_put_node(&ef, node);
}
exfat_closedir(&ef, &it);
return ro ? add_option(options, "ro", NULL) : options;
}
+#if defined(__linux__) || defined(__FreeBSD__)
static char* add_user_option(char* options)
{
struct passwd* pw;
}
return add_option(options, "user", pw->pw_name);
}
+#endif
+#if defined(__linux__)
static char* add_blksize_option(char* options, long cluster_size)
{
long page_size = sysconf(_SC_PAGESIZE);
snprintf(blksize, sizeof(blksize), "%ld", MIN(page_size, cluster_size));
return add_option(options, "blksize", blksize);
}
+#endif
static char* add_fuse_options(char* options, const char* spec, bool ro)
{
options = add_ro_option(options, ro);
if (options == NULL)
return NULL;
+#if defined(__linux__) || defined(__FreeBSD__)
options = add_user_option(options);
if (options == NULL)
return NULL;
+#endif
+#if defined(__linux__)
options = add_blksize_option(options, CLUSTER_SIZE(*ef.sb));
if (options == NULL)
return NULL;
-
+#endif
return options;
}
printf("FUSE exfat %s\n", VERSION);
fuse_options = strdup("allow_other,"
+#if defined(__linux__) || defined(__FreeBSD__)
"big_writes,"
+#endif
+#if defined(__linux__)
"blkdev,"
+#endif
"default_permissions");
exfat_options = strdup("ro_fallback");
if (fuse_options == NULL || exfat_options == NULL)
free(exfat_options);
- fuse_options = add_fuse_options(fuse_options, spec, (ef.ro == -1));
+ fuse_options = add_fuse_options(fuse_options, spec, ef.ro != 0);
if (fuse_options == NULL)
{
exfat_unmount(&ef);