[Xfce4-commits] <midori:master> Use file info can-write instead of Posix.Access

Christian Dywan noreply at xfce.org
Sat Sep 15 01:22:04 CEST 2012


Updating branch refs/heads/master
         to 29716305b53bd01105b758cfd8bfdc7000d0c0a5 (commit)
       from 5fdd9bdee0fd524adf26bad897b3a499a06150e9 (commit)

commit 29716305b53bd01105b758cfd8bfdc7000d0c0a5
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Sep 14 23:53:36 2012 +0200

    Use file info can-write instead of Posix.Access

 midori/midori-download.vala |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/midori/midori-download.vala b/midori/midori-download.vala
index cd294fb..806496a 100644
--- a/midori/midori-download.vala
+++ b/midori/midori-download.vala
@@ -282,15 +282,17 @@ namespace Midori {
 
         public static bool has_enough_space (WebKit.Download download, string uri) {
             var folder = File.new_for_uri (uri).get_parent ();
+            bool can_write;
             uint64 free_space;
             try {
-                var info = folder.query_filesystem_info ("filesystem::free");
+                var info = folder.query_filesystem_info ("access::can-write,filesystem::free");
+                can_write = info.get_attribute_boolean ("access::can-write");
                 free_space = info.get_attribute_uint64 ("filesystem::free");
             }
             catch (Error error) {
+                can_write = false;
                 free_space = 0;
             }
-            bool can_write = Posix.access (folder.get_path (), Posix.F_OK) == 0;
             if (free_space < download.total_size || !can_write) {
                 string message;
                 string detailed_message;


More information about the Xfce4-commits mailing list