-sub templates_cache_writable {
- my $dir = $::lx_office_conf{paths}->{userspath} . '/templates-cache';
- return 1 if -w $dir;
-
- # 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;