diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-11 11:50:48 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-11 11:50:48 +0000 |
commit | 78196db058807d48f2c755ea8e4fa61c11bee0cc (patch) | |
tree | bf35494c86fe184b5efd034f12354c7f2fd3d9ed /NetWare/NWUtil.c | |
parent | 7f01e9eb568fcd05e80ff03d218f3770ea23fc08 (diff) | |
download | perl-78196db058807d48f2c755ea8e4fa61c11bee0cc.tar.gz |
NetWare update from Ananth Kesari.
p4raw-id: //depot/perl@12002
Diffstat (limited to 'NetWare/NWUtil.c')
-rw-r--r-- | NetWare/NWUtil.c | 26 |
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; } |