Skip to content

Commit

Permalink
Fix file permissions problem. #329
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileSonneveld committed Oct 17, 2024
1 parent 945d360 commit 704ddb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ package object geotiff {
uploadToS3(tempFile, correctS3Path)

} else {
val tempFile = Files.createTempFile(null, ".tif")
val tempFile = getTempFile(null, ".tif")
// TODO: Try to run fsync on the file opened by GeoTrellis (without the temporary copy)
geoTiff.write(tempFile.toString, optimizedOrder = true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ package object geotrellis {
}

/**
* Inspired on 'Files.createTempFile'
* Inspired on 'Files.createTempFile', but does not create an empty file.
* The default permissions of 'createTempFile' are a bit too strict too: 600, which is not accessible by other users.
* This function could have default 664 for example.
*/
def getTempFile(prefix: String, suffix: String): Path = {
val prefixNonNull = if (prefix == null) "" else suffix
Expand Down

0 comments on commit 704ddb3

Please sign in to comment.