Jump to content
Sign in to follow this  

Problem with _Tempfile

Recommended Posts

I am not sure if it is a bug or my interpretation of the help?

I have tried the following:

$fn = _tempfile(@scriptdir & "dir1dir2","AB_",".txt")


$tpath = @scriptdir & "dir1dir2"

$fn = _tempfile($tpath,"AB_",".txt")

In both cases the result for $fn is that it substitutes the directory path held in %Temp%

By using an expilcit path it works.

$fn = _tempfile("C:dirAdirBdir1dir2","AB_",".txt")

Is this as designed, as I expected all to be evaluated correctly and that the temp path would be defaulted to when "" a blank parameter was enetered.



Share this post

Link to post
Share on other sites

Hi Guys

Thanks, for clarifying the operation of this function.  I was using the tempfile() function to create a random unique filename which I was subsequently opening using fileopen($fn,10) to create the path and open the file if it did not exists.

I have used the _tempfile function previously without a problem.

All has become clear.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...