diff options
author | Charles Bailey <bailey@newman.upenn.edu> | 2000-05-29 16:22:08 +0000 |
---|---|---|
committer | bailey <bailey@newman.upenn.edu> | 2000-05-29 16:22:08 +0000 |
commit | 674d6c381cbfa67bc93fd195278b889049c14bba (patch) | |
tree | 2efaa441c4d289143580b4dcb2d7a450d8e7be0a /vms/vms.c | |
parent | bdb84599aeb6d8fcc1319c109c1240cbc6c835db (diff) | |
download | perl-674d6c381cbfa67bc93fd195278b889049c14bba.tar.gz |
Add fallback to tmpfile for use in cases where user's relying on
ACLs on SYS$SCRATCH to permit file creation. (based on Charles
Lane's patch)
p4raw-id: //depot/vmsperl@6158
Diffstat (limited to 'vms/vms.c')
-rw-r--r-- | vms/vms.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -936,6 +936,28 @@ my_chdir(char *dir) } /* end of my_chdir */ /*}}}*/ + +/*{{{FILE *my_tmpfile()*/ +FILE * +my_tmpfile(void) +{ + FILE *fp; + char *cp; + dTHX; + + if ((fp = tmpfile())) return fp; + + New(1323,cp,L_tmpnam+24,char); + strcpy(cp,"Sys$Scratch:"); + tmpnam(cp+strlen(cp)); + strcat(cp,".Perltmp"); + fp = fopen(cp,"w+","fop=dlt"); + Safefree(cp); + return fp; +} +/*}}}*/ + + static void create_mbx(unsigned short int *chan, struct dsc$descriptor_s *namdsc) { |