Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000315OCamlOCaml generalpublic2001-03-20 15:352001-03-29 15:16
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000315: Filename.temp_file doc not precise enough
DescriptionFull_Name: Judicaƫl Courant
Version: ocaml-3.01
OS: Linux
Submission from: ext2.lri.fr (129.175.15.5)


The doc of Filename.temp_file says

temp_file prefix suffix returns the name of a non-existent temporary file in
the temporary directory. [blabla]

It should say:

temp_file prefix suffix *creates* a non-existent 0-length temporary file in
the temporary directory and returns its name. [blabla]

Otherwise, you are tempted to believe that in order to prevent the race
condition,
you should typically do :
let open_temp () =
  try open_out_gen [Open_excl] Oo666 (Filename.temp_file "foo" ".bar") with
  | Sys_error _ -> open_temp ()

This would funnily not necessarily full the temporary directory but would
say "Filename.temp_file: temp dir nonexistent or full"...

BTW, why is there this undocumented hard limit of 1000 on the number of
temporary
file with a given prefix and suffix ? I think at least the message could be
improved.

Judicaƫl.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000537)
administrator (administrator)
2001-03-29 15:16

> The doc of Filename.temp_file says
>
> temp_file prefix suffix returns the name of a non-existent temporary file in
> the temporary directory. [blabla]
>
> It should say:
>
> temp_file prefix suffix *creates* a non-existent 0-length temporary file in
> the temporary directory and returns its name. [blabla]

Fixed. Thanks for the suggestion.

> This would funnily not necessarily full the temporary directory but would
> say "Filename.temp_file: temp dir nonexistent or full"...
> BTW, why is there this undocumented hard limit of 1000 on the number
> of temporary file with a given prefix and suffix ? I think at least
> the message could be improved.

The test wasn't there initially, but without it we get an infinite
loop if the temporary directory doesn't exist. This sometimes happens
on Windows machines where \temp is missing. (It actually happened to
Henri Laulhere when compiling Coq in native-code on his Windows
machine; ocamlopt just entered an endless loop trying to find a
suitable temp file for its asm output...)

- Xavier Leroy

(0000538)
administrator (administrator)
2001-03-29 15:16

Fixed 2001-03-29 by XL.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker