aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-03-31 20:57:55 -0700
committerScott Jackson <daneren2005@gmail.com>2014-03-31 20:57:55 -0700
commit25ac45d04a6c9a248d08b2c2952d6d04c482e15b (patch)
treec46d23fde504d97de93d19138d6049ceb98bc9ed /src/github/daneren2005
parentd66a640e877612589ef55be0d563b1abd0b5852c (diff)
downloaddsub-25ac45d04a6c9a248d08b2c2952d6d04c482e15b.tar.gz
dsub-25ac45d04a6c9a248d08b2c2952d6d04c482e15b.tar.bz2
dsub-25ac45d04a6c9a248d08b2c2952d6d04c482e15b.zip
Fix samsung even allowing create temp on non-writable
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/util/FileUtil.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/util/FileUtil.java b/src/github/daneren2005/dsub/util/FileUtil.java
index 3b45115b..4b425775 100644
--- a/src/github/daneren2005/dsub/util/FileUtil.java
+++ b/src/github/daneren2005/dsub/util/FileUtil.java
@@ -379,9 +379,13 @@ public class FileUtil {
public static boolean verifyCanWrite(File dir) {
if(ensureDirectoryExistsAndIsReadWritable(dir)) {
try {
- File tmp = File.createTempFile("tmp", "tmp", dir);
- tmp.delete();
- return true;
+ File tmp = new File(dir, "tmp");
+ if(tmp.createNewFile()) {
+ tmp.delete();
+ return true;
+ } else {
+ return false;
+ }
} catch(Exception e) {
return false;
}