Page 1 of 1

TEMP variable

Posted: Mon Jul 09, 2007 6:41 pm
by asito
I have an application that has 3 big modules (3 diferent exes) that share several files on a LAN. It has been running for a couple of years now. I upgraded to FW 7.01 about 6 months ago. About a month ago we began to get an error when trying to issue rerport previews:

Could not create temporary file C:\TEMP696322880.wmf
Please check your free space.......
Followed for: check your enviromental variables.....

Drive C has several gbs free. SET CLIPPER is set to 90, HandleCount is set to 90 (I just increased them).
It began on 1 pc, but now the error is on 3 of them.
I get no errors on my PC.

Does anyone know how to solve this problem?

Thanks

Posted: Tue Jul 10, 2007 10:55 pm
by asito
I solved the problem increasing CLIPPER=F120 (for now).
The weird thing is that the application had run for a couple of years with F60. There were no changes on the client side, same NT os.
The only thing that changed was the compiler and some minor modifications to the app, but it gave no problems for 4 or 5 months.

Posted: Wed Jul 11, 2007 7:39 am
by Antonio Linares
You should consider to upgrade your application to 32 bits using FWH and Harbour/xharbour as such problem does not exist on 32 bits

Posted: Mon Jul 16, 2007 8:51 pm
by asito
Gracias Antonio,

I will consider changing to FWH, but I can't do it right now because I'm developing 5 other applications and the change would impact me severely on the delivery time (I donĀ“t have any problems with the other applications).

It worked fine for several days with CLIPPER=F120 but today it gave the error again, any other suggestion in the meantime?

Saludos
Andres

Posted: Mon Jul 16, 2007 9:24 pm
by Gale FORd
Isn't there a limit to the length of the filename in clipper?

Posted: Mon Jul 16, 2007 9:46 pm
by James Bott
Do all the users have the rights to create files in the root directory?

James

Posted: Tue Jul 17, 2007 12:03 am
by asito
Hi James,

Yes. The program is trying to create a temp file in C:\TEMP. They have administrator rights on their pc's.
Last week was running fine with the same configuration.

Regards
Andres

Gale
Yes there is the same limit as in DOS 8 chars. But what does it have to do with it?

Posted: Tue Jul 17, 2007 5:49 am
by James Bott
Andres,

>Yes there is the same limit as in DOS 8 chars. But what does it have to do with it?

>Could not create temporary file C:\TEMP696322880.wmf

As you can see the filename you showed is greater than 8 chars, so perhaps there is already a file with the same first 8 characters. This may be a FW/Clipper bug--I don't know. When FW is running as 16bit it should only be generating temp filenames that are 8 characters long.

James

Posted: Tue Jul 17, 2007 6:38 am
by Antonio Linares
In source\function\filename.prg change function cTempFile() to return this:

return LFN2SFN( cFileName )

Posted: Wed Jul 18, 2007 4:09 am
by hua
In source\function\filename.prg change function cTempFile() to return this:

return LFN2SFN( cFileName )
Pardon me if I make the wrong conclusion here, but wouldn't placing lfn2sfn() here would result in cTempfile() to always return a null string since cFileName is yet to be created?

Posted: Wed Jul 18, 2007 6:49 am
by Antonio Linares
cFileName is already created and the function returns it.

If we return LFN2SFN() then we use it in 8.3 name format

Posted: Wed Jul 18, 2007 4:05 pm
by asito
Hola Antonio,

I tried LFN2SFN() and I began to get the same error on my stand alone pc (it worked fine there before).
What I did and seems to work fine is:

while File( cFileName := ( cPath + LTrim( Str( GetTickCount(),8 ) ) + cExtension ) )

I have to test it some more on my client's lan and will let you all know

Thanks

I changed the while to verify that the file does not exist before returning the name. It seems to work fine too, but I don't know if it can have consecuenses on other funtcions.

lTkt := .t.
while lTkt
cFileName := ( cPath + LTrim( Str( GetTickCount(),8 ) ) + cExtension)
if .not. File( cFileName )
lTkt := .f.
endif
end

Posted: Wed Jul 18, 2007 4:35 pm
by Antonio Linares
Yes, you are right, because if a not valid filename is used then File() will not properly work

Posted: Thu Jul 19, 2007 11:01 pm
by asito
Hi again,

I finally got it working. The problem was that 2 old Pentium II pcs running NT had problems with the GetTickCount function. I replaced it with nRandom and now is working fine.
The XP's pcs had no problems.

Thanks a lot