Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#597 closed Bug (No Bug)

Documentation @TempDir needs updating

Reported by: Emiel Wieldraaijer Owned by:
Milestone: Component: Documentation
Version: 3.2.12.0 Severity: None
Keywords: @TempDir description Cc:

Description

Macro Reference - Directory
@TempDir -> path to the temporary files folder <-

This information is not complete because the @TempDir retrieves %TEMP% and not %TMP% which is also used for temporary files.

Attachments (0)

Change History (6)

comment:1 Changed 11 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

That's wrong. @TempDir will return whatever it finds first:

  1. The path specified by the TMP environment variable.
  2. The path specified by the TEMP environment variable.
  3. The path specified by the USERPROFILE environment variable.
  4. The Windows directory.

So it will find TMP first if it exists:

MsgBox(4096, "", @TempDir)
EnvSet("TMP", "C:\Fake")
MsgBox(4096, "", @TempDir)

I don't see that this needs documented, however. People have been using the macro for years and have never needed to know how it was implemented.

comment:2 follow-up: Changed 11 years ago by Emiel Wieldraaijer

Ok ..

Than it will also need updating ..

Because as you say it will only retrieve the first folder it finds

(Example)
I want to clean the TMP location so i use FileDelete (@TempDir & "\*.*")
I want to clean the TEMP location so i use FileDelete (@TempDir & "\*.*")
I want to clean the Windows\Temp location so i use FileDelete (@TempDir & "\*.*")

But i don't know what he will find first ..

Hmmm ..

Tell Me.. i want to clean my Temp -> Documentation Tells me @TempDir

comment:3 in reply to: ↑ 2 Changed 11 years ago by Valik

Replying to Emiel Wieldraaijer:

Ok ..

Than it will also need updating ..

Because as you say it will only retrieve the first folder it finds

I never said anything about folders. In fact, @TempDir will return a non-existing path if the environment variable is not configured correctly (as my example script should have alerted you to). The existence of the path has nothing to do with the value returned, only the existence of the environment variable affects that.

(Example)
I want to clean the TMP location so i use FileDelete (@TempDir & "\*.*")
I want to clean the TEMP location so i use FileDelete (@TempDir & "\*.*")
I want to clean the Windows\Temp location so i use FileDelete (@TempDir & "\*.*")

But i don't know what he will find first ..

Don't ask me to document behavior so you can write bad code. If you need to delete the files at those directories then get the paths from the environment so you know exactly what you're getting.

Tell Me.. i want to clean my Temp -> Documentation Tells me @TempDir

You're missing a critical point here. You seem to be wanting to use @TempDir as the end-all solution that it simply is not. If you want to delete all temporary files then you need to learn where such files can be stored and write your code to clean those. However, if you are looking for the primary location of temporary files on the system then @TempDir is your macro.

comment:4 Changed 11 years ago by Emiel Wieldraaijer

Hi Valik,

just playing dumb with "Tell Me.. i want to clean my Temp -> Documentation Tells me @TempDir" Nothing to do with bad code.. i just read the @TempDir in the documentation.. and did not find it well enough explained.

Thanks.

Emiel

comment:5 Changed 11 years ago by Valik

Where did you find that in the documentation? Where does the documentation say that in order to clean the temporary files you use @TempDir?

comment:6 Changed 11 years ago by anonymous

Who's playing stupid now...

@TempDir = path to the temporary files folder

End Communication

Sorry for wasting your time

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.