Closed Bug 696084 Opened 13 years ago Closed 8 years ago

There is no temporary directory on Android

Categories

(Core :: Networking: File, defect)

x86
Android
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: Yoric, Unassigned)

Details

(Keywords: mobile, Whiteboard: [necko-would-take])

By definition, there is no such thing as a temporary directory on Android. However, at the moment, GetSpecialSystemDirectory returns "/tmp", which is simply false.

Either GetSpecialSystemDirectory should fail on Android, or we should implement a notion of temporary directory by ourselves.
Turns out that I'm partially wrong. Thanks to GeckoAppShell monkey-patching TEMP, GetSpecialSystemDirectory returns an existing directory. However, this directory does not behave as a temporary directory, insofar as it is never cleaned-up.

I suggest the following mechanism:
- don't return Activity.getDir("tmp", ...) but Activity.getDir("tmp/randomuniquename", ...)
- store both that directory and Activity.getDir("tmp", ...)
- spawn a thread that, after a few seconds, starts progressively removing all other directories from "tmp".
Working on a patch.
wontfix?
Flags: needinfo?(dteller)
Whiteboard: [necko-would-take]
Yeah, let's.
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(dteller)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.