Wiki Home

Tmp Files


Namespace: VFP
My observations of Visual FoxPro temporary files indicates that if you don't specify the TMPFILES, SORTWORK, etc. in a Config Dot Fpw then VFP will use whatever the OS TEMP environment variable points to as long as that directory actually exists. Otherwise, it dumps them in the startup directory. I don't believe I've seen this documented very well anywhere and in fact the VFP help file just mentions that TMPFILES defaults to the startup directory.

Frankly, I have not found a need for the Config Dot Fpw temporary files settings since the DOS days.

The reason I created this topic is that I have seen some people suggesting to newbies that they should have Config Dot Fpw pointing to absolute temporary directories on the local HD to keep temp files off the network. I see no reason for it in VFP. I've never done it and I have never seen any temporary files created or left on network drives even when that's where the EXE gets launched from.

Somebody please correct me if I'm wrong.

Use SYS(2023) to determine where temporary files will be created.

Default behavior on Windows 2000 is that Temp files created by VFP will go to the path specified in the Config Dot Fpw or C:\Documents and Settings\USERNAME\Local Settings \ Temp

-- Dave Noal


What is the best way to specify a unique directory for temp files (cursor .tmp's etc) on a per-user basis? For example, VFP app installed on a Metaframe server should not allow users to write to the app or shared-data directory, but each user at logon gets its own %temp% setting. How to make sure a particular %temp% always gets used?

I belive the default behavior (no config or TMPFILES) is what you want: temp files will be created in the user's temp dir assigned by the OS. Why do you not want write access to the shared-data directory? I have been trying to figure out the right place for things like this - see Dbf Location. -?cfk
Contributors Randy Jean Carl Karsten

MAybe using something like %user profile% in the path name for the temp system variable will always put the working files in different directories for each user?
Category Configuration Management
Hello,

There is no doubt the temp dir has to be always on the local machine - and it still is. In my opinion it makes no sense dealing with different directories for different users, because it is just temporary and vfp can deal with it - even with multiple processes on one machine.

I use the config.fpw-Entry "TMPFILES" just for one special reason:
- If your app works with many Cursors or with a huge number of objects creating temp-files, you want them to be deleted after work is done. This works pretty well with sys(2023),%temp% whatever. If now your application crashes sometimes (yes it will), the clean-up mechanism is gone and with every crash the temp-dir is filled with hundreds of files. If you run apps on serverside you cant (not always) do sth like "del %temp%\*.*", because there is not only your stuff in there...

In order to deal with it, i create start-apps that has just the following functionality:
- look what is written for "TMPFILES" in config.fpw
- not there? Create it
- Was still there? delete the content of this folder if it has a special form (in order not to delete important dirs^^).
- Starting the real application (that now cashes files in a existing separate clean dir on your local machine). In my apps its sth like %temp%\vfp\ or %temp%\appname\

If you consider all the other benefits of start-apps (like exe-replacement with online-update, firewall & virusscan don't cry on double click cause the start-apps have still the same crc, One link on desktop starts maybe different applications (factory pattern)...) it is a good way to deal with the vfp-temp-files.

have fun,
Alexander Lagler
( Topic last updated: 2008.01.08 03:39:09 AM )