Jump to content

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")

OR

$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.

Alan

 

Link to comment
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.

Cheers

Alan

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...