| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -112,11 +112,14 @@ public boolean accept(File file) { | |||
| 112 | 112 | } | |
| 113 | 113 | } else { | |
| 114 | 114 | consoleDir.mkdirs(); | |
| 115 | + consoleDir.setWritable(true, false); | ||
| 115 | 116 | } | |
| 116 | 117 | ||
| 117 | 118 | File outFile = new File(consoleDir, stamp + ".out"); | |
| 119 | + outFile.setWritable(true, false); | ||
| 118 | 120 | stdoutFile = new FileOutputStream(outFile); | |
| 119 | 121 | File errFile = new File(consoleDir, stamp + ".err"); | |
| 122 | + errFile.setWritable(true, false); | ||
| 120 | 123 | stderrFile = new FileOutputStream(errFile); | |
| 121 | 124 | ||
| 122 | 125 | consoleOut = new PrintStream(new ConsoleStream(false)); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -147,6 +147,7 @@ static private String loadLanguage() { | |||
| 147 | 147 | static public void saveLanguage(String language) { | |
| 148 | 148 | try { | |
| 149 | 149 | Util.saveFile(language, prefFile); | |
| 150 | + prefFile.setWritable(true, false); | ||
| 150 | 151 | } catch (Exception e) { | |
| 151 | 152 | e.printStackTrace(); | |
| 152 | 153 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -216,6 +216,7 @@ static public void save() { | |||
| 216 | 216 | try { | |
| 217 | 217 | File dir = preferencesFile.getParentFile(); | |
| 218 | 218 | File preferencesTemp = File.createTempFile("preferences", ".txt", dir); | |
| 219 | + preferencesTemp.setWritable(true, false); | ||
| 219 | 220 | ||
| 220 | 221 | // Fix for 0163 to properly use Unicode when writing preferences.txt | |
| 221 | 222 | PrintWriter writer = PApplet.createWriter(preferencesTemp); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,7 +69,7 @@ private ContributionListing() { | |||
| 69 | 69 | ||
| 70 | 70 | //listingFile = Base.getSettingsFile("contributions.txt"); | |
| 71 | 71 | listingFile = Base.getSettingsFile(LOCAL_FILENAME); | |
| 72 | - listingFile.setWritable(true); | ||
| 72 | + listingFile.setWritable(true, false); | ||
| 73 | 73 | if (listingFile.exists()) { | |
| 74 | 74 | setAdvertisedList(listingFile); | |
| 75 | 75 | } | |
@@ -422,7 +422,7 @@ public void run() { | |||
| 422 | 422 | // System.out.println(contribInfo.length() + " " + contribInfo); | |
| 423 | 423 | ||
| 424 | 424 | File tempContribFile = Base.getSettingsFile("contribs.tmp"); | |
| 425 | - tempContribFile.setWritable(true); | ||
| 425 | + tempContribFile.setWritable(true, false); | ||
| 426 | 426 | ContributionManager.download(url, base.getInstalledContribsInfo(), | |
| 427 | 427 | tempContribFile, progress); | |
| 428 | 428 | if (!progress.isCanceled() && !progress.isError()) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -77,6 +77,16 @@ public void initBase(Base base) { | |||
| 77 | 77 | // Attempt to work around this in the least invasive manner, | |
| 78 | 78 | // so that "sudo -E processing" or "sudo -E processing-java" | |
| 79 | 79 | // will pick up the invoking user's sketchbook folder instead. | |
| 80 | + public File getSettingsFolder() throws Exception { | ||
| 81 | + String sysEnvHome = System.getenv("HOME"); | ||
| 82 | + if (sysEnvHome != null && 0 < sysEnvHome.length()) { | ||
| 83 | + return new File(sysEnvHome, ".processing"); | ||
| 84 | + } else { | ||
| 85 | + return super.getSettingsFolder(); | ||
| 86 | + } | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + | ||
| 80 | 90 | public File getDefaultSketchbookFolder() throws Exception { | |
| 81 | 91 | String sysEnvHome = System.getenv("HOME"); | |
| 82 | 92 | if (sysEnvHome != null && 0 < sysEnvHome.length()) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -103,6 +103,7 @@ static protected void load() throws IOException { | |||
| 103 | 103 | ||
| 104 | 104 | ||
| 105 | 105 | static protected void save() { | |
| 106 | + file.setWritable(true, false); | ||
| 106 | 107 | PrintWriter writer = PApplet.createWriter(file); | |
| 107 | 108 | writer.println(VERSION); | |
| 108 | 109 | for (Record record : records) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments