summaryrefslogtreecommitdiff
path: root/NetWare/NWUtil.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-09-11 11:50:48 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-11 11:50:48 +0000
commit78196db058807d48f2c755ea8e4fa61c11bee0cc (patch)
treebf35494c86fe184b5efd034f12354c7f2fd3d9ed /NetWare/NWUtil.c
parent7f01e9eb568fcd05e80ff03d218f3770ea23fc08 (diff)
downloadperl-78196db058807d48f2c755ea8e4fa61c11bee0cc.tar.gz
NetWare update from Ananth Kesari.
p4raw-id: //depot/perl@12002
Diffstat (limited to 'NetWare/NWUtil.c')
-rw-r--r--NetWare/NWUtil.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/NetWare/NWUtil.c b/NetWare/NWUtil.c
index 9cc5b5c629..ea0e4856ae 100644
--- a/NetWare/NWUtil.c
+++ b/NetWare/NWUtil.c
@@ -735,6 +735,7 @@ char* fnMy_MkTemp(char* templatestr)
char termchar = '\0';
char letter = 'a';
+ char letter1 = 'a';
if (templatestr && (pXs = strstr(templatestr, (char *)"XXXXXX")))
@@ -753,6 +754,14 @@ char* fnMy_MkTemp(char* templatestr)
else
pPid = numbuf;
+/**
+ Backtick operation uses temp files that are stored under DEFPERLTEMP directory.
+ They are temporarily used and then cleaned up after usage.
+ In the process of operation to allow for more temp files, the below logic is used.
+ This allows 26 files (like, pla00015.tmp through plz00015.tmp) plus
+ 26x26=676 (like, plaa0015.tmp through plzz0015.tmp)
+**/
+
letter = 'a';
do
{
@@ -765,6 +774,23 @@ char* fnMy_MkTemp(char* templatestr)
letter++;
} while (letter <= 'z');
+ letter1 = 'a';
+ do
+ {
+ letter = 'a';
+ do
+ {
+ sprintf(pXs, (char *)"%c%c%04.5s", letter1, letter, pPid);
+ pXs[6] = termchar;
+ if (access(templatestr, 0) != 0) // File does not exist
+ {
+ return templatestr;
+ }
+ letter++;
+ } while (letter <= 'z');
+ letter1++;
+ } while (letter1 <= 'z');
+
errno = ENOENT;
return NULL;
}