diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 7481d24..136652c 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -1799,26 +1799,16 @@ vfs_rmdir (const gchar *path)
 }
 
 static gboolean
-file_handle_get_size (FileHandle *fh,
+file_get_size (GFile *file,
 		      goffset *size)
 {
-  GFileInfo *info;
+  GFileInfo *info = NULL;
+  GError *error  = NULL;
   gboolean res;
-
-  if (fh->stream == NULL)
-    return FALSE;
   
-  info = NULL;
-  if (fh->op == FILE_OP_READ)
-    info = g_file_input_stream_query_info (fh->stream,
-					   G_FILE_ATTRIBUTE_STANDARD_SIZE,
-					   NULL, NULL);
-  else if (fh->op == FILE_OP_WRITE)
-    info = g_file_output_stream_query_info (fh->stream,
-					    G_FILE_ATTRIBUTE_STANDARD_SIZE,
-					    NULL, NULL);
-
   res = FALSE;
+  info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_SIZE, 0, NULL, &error);
+
   if (info)
     {
       if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SIZE))
@@ -1828,6 +1818,12 @@ file_handle_get_size (FileHandle *fh,
 	}
       g_object_unref (info);
     }
+
+  if (error)
+    {
+      g_error_free (error);
+    }
+
   return res;
 }
 
@@ -1877,7 +1873,7 @@ vfs_ftruncate (const gchar *path, off_t size, struct fuse_file_info *fi)
                       fh->stream = NULL;
                     }
                 }
-              else if (file_handle_get_size (fh, &current_size) &&
+              else if (file_get_size (file, &current_size) &&
 		       current_size == size)
 		{
 		  /* Don't have to do anything to succeed */
