Workaround FUSE missing the generally broken Linux kernel charset support.
[captive.git] / src / client / fuse / op_getattr.c
index 071027e..7d1b88e 100644 (file)
 #include "op_getattr.h"        /* self */
 #include "main.h"
 #include "gnomevfsresult.h"
-#include "gnomevfsfileinfo.h"
+#include "capfuse_captive_file_info_object.h"
+#include "utf8.h"
 
 
 int op_getattr(const char *path,struct stat *buf)
 {
 CaptiveFileObject *captive_file_object;
 GnomeVFSResult errvfsresult;
-GnomeVFSFileInfo file_info;
+CaptiveFileInfoObject *captive_file_info_object;
 int errint;
 
        g_return_val_if_fail(path!=NULL,-EINVAL);
        g_return_val_if_fail(buf!=NULL,-EINVAL);
 
+  path=CAPFUSE_FILENAME_TO_UTF8_ALLOCA(path);
+
        if (GNOME_VFS_OK!=(errvfsresult=captive_file_new_open(&captive_file_object,capfuse_captive_vfs_object,path,0)))
                return -gnomevfsresult_to_errno(errvfsresult);
 
-       /* Pre-clear to take care of any fields not touched by libcaptive there. */
-       CAPTIVE_MEMZERO(&file_info);
-       errvfsresult=captive_file_file_info_get(captive_file_object,&file_info);
+       errvfsresult=captive_file_file_info_get(captive_file_object,&captive_file_info_object);
 
        g_object_unref(captive_file_object);
        if (GNOME_VFS_OK!=errvfsresult)
                return -gnomevfsresult_to_errno(errvfsresult);
-       errint=gnomevfsfileinfo_to_stat(buf,&file_info);
-       gnome_vfs_file_info_clear(&file_info);
+       errint=capfuse_captive_file_info_object_to_stat(buf,captive_file_info_object);
+       g_object_unref(captive_file_info_object);
 
        return errint;
 }