You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4003 Reporter:@mmottl Assigned to:@xclerc Status: closed (set by @xavierleroy on 2011-05-29T10:20:22Z) Resolution: fixed Priority: normal Severity: feature Version: 3.10+dev Fixed in version: 3.11.2+dev Category: ~DO NOT USE (was: OCaml general) Monitored by: spiralvoice @mmottl@zoggy
Bug description
Temporary files as generated by "open_temp_file" and "temp_file" are generated in either /tmp (default) or the value of the environment variable "TMPDIR" at startup time. Unfortunately, the temporary directory may be on a different filesystem than the directory where the final file should be moved to. This means that "Sys.rename" will fail (at least on Unix-systems), and even if it worked, it would have to copy the file to the other filesystem, which may take a long time. Since the environment variable is only read at startup, this cannot be changed at runtime, and even if, it would cause problems with threads.
It seems therefore advisable to add functions that perform creation of temporary files in a directory provided at runtime, or using a given filestem.
Both Filename.temp_file and Filename.open_temp_file functions now
take an additional optional parameter that is the directory in which the
temporary file should be created.
Original bug ID: 4003
Reporter: @mmottl
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2011-05-29T10:20:22Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.10+dev
Fixed in version: 3.11.2+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: spiralvoice @mmottl @zoggy
Bug description
Temporary files as generated by "open_temp_file" and "temp_file" are generated in either /tmp (default) or the value of the environment variable "TMPDIR" at startup time. Unfortunately, the temporary directory may be on a different filesystem than the directory where the final file should be moved to. This means that "Sys.rename" will fail (at least on Unix-systems), and even if it worked, it would have to copy the file to the other filesystem, which may take a long time. Since the environment variable is only read at startup, this cannot be changed at runtime, and even if, it would cause problems with threads.
It seems therefore advisable to add functions that perform creation of temporary files in a directory provided at runtime, or using a given filestem.
File attachments
The text was updated successfully, but these errors were encountered: