+  # Try actually creating a file. Due to ACLs this might be possible
+  # even if the basic Unix permissions and Perl's -w test say
+  # otherwise.
+  my $file = "${dir}/.writetest";
+  my $out  = IO::File->new($file, "w") || return 0;
+  $out->close;
+  unlink $file;
+
+  return 1;