Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Absent Member.
Absent Member.
1068 views

Client for OES 2 SP4 (IR6) fails in C rename()

with the Client for Open Enterprise Server 2 SP4 (IR6) I am seeing a failure. It works in SP3 (IR8) .

To reproduce:

  • map to a netware shared drive (e.g. NET USE I: \\MyDomain\NWServer)
  • make an empty folder (e.g. cd \ & rd t /s & md t)
  • Add the subdirectory 'AL2' (md \t\al2)
  • change to the first directory (cd \t)
  • copy in the test executable with a rename function and execute it



The test executable I used was compiled with VC++ (Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86) as well as an ancient version of Borland - the results were identical. After the executable is run, the following line fails:
echo. > \t\TEMP.$$$

The code below creates a file named 'TEMP.$$$' then renames and moves the file into the AL2 directory. Something of TEMP.$$$ is apparently left behind.

#include <stdio.h>
#include <string.h>
#include <process.h>

char mapfname[40],cfname[40],flgfname[40],cnwfname[40],line[400];
char exefname[40],syscmd[128];
char name[300],fakename[40];
char path[80];
FILE *fp,*fp1,*fp2,*fp3;

void main(int argc,char **argv)
{
char *ptr;
(void)argc;
(void)argv;

strcpy(name,"DAC");
strcpy(path,"AL2");
sprintf(mapfname,"%s\\%s.MAP",path,name);
sprintf(exefname,"%s\\%s.EXE",path,name);
sprintf(cfname,"%s\\%s_MAP.C",path,name);
sprintf(flgfname,"%s\\%s_MAP.FLG",path,name);
sprintf(cnwfname,"%s\\%s.CNW",path,name);

fp1 = fopen("temp.$$$","wt");
fputs("Some nonsense\n",fp1);
fcloseall();
remove(cfname);
rename("temp.$$$",cfname);

exit(0);
}
Labels (1)
0 Likes
0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.