PerlIO_tmpfile leaves a lot of temporary files lying around on VMS because it does an (unsuccessful) unlink() immediately after opening the temporary file. Our unlink is based on remove(), and remove()ing an open file is implementation-defined behavior according to C99,and for whatever reason it doesn't work on this implementation.

The attached patch makes VMS revert to using PerlSIO_tmpfile, which works fine because it sets the delete-on-close flag for the file.


--- perlio.c;-0 Sat Aug 30 15:12:10 2003
+++ perlio.c    Fri Sep 12 11:57:51 2003
@@ -4861,7 +4861,7 @@
      if (fd >= 0)
          f = PerlIO_fdopen(fd, "w+b");
 #else /* WIN32 */
-#    ifdef HAS_MKSTEMP
+#    if defined(HAS_MKSTEMP) && ! defined(VMS)
      SV *sv = newSVpv("/tmp/PerlIO_XXXXXX", 0);
 
      /*

Reply via email to