hisundar
hisundar

Reputation: 5

Why does System.getProperty("java.io.tmpdir") return a read-only directory on Mac OS X Catalina 10.15

This method used to return a writable directory until Mac OS X Mojave. Starting with Catalina. Is there a way to add writability to the permissions of this temporary dir returned?

ls -larth
/var/folders/qx/045nmsxx55575_gqycvvs1480000gp/T/1579829982927-0 total 16
drwxr-xr-x 4 me staff 128B Jan 23 17:39 .
drwx------@ 118 me staff 3.7K Jan 23 17:39 ..

Upvotes: 0

Views: 4420

Answers (1)

rzwitserloot
rzwitserloot

Reputation: 103273

It IS writable; that line means it is a directory, and the directory's owner can write to it just fine (which, would be you, and by extension, all processes you invoke).

The problem with the old /tmp solution is that everyone and everything can write to it, so using it for just about anything is a security issue.

Upvotes: 2

Related Questions