Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

programmatically changing location of tmpfiles

Status
Not open for further replies.

prapti

Programmer
Nov 3, 2006
27
BE
i need to change programmatically the location of tmp files.

depending on who is logging into the program the tmp files location will change.

which means i need to do it in the program NOT in the config.fpw file as far as i understand.

so how is this done?


 
Hi Prapti,

Which temp files are you referring to?

Are you trying to change the place where Windows stores its temp files? If so, I don't think that's possible. Anyway, I can't think of any good reason to want to do it.

Or do you mean the place where your application stores its own temp files? If so, there's no problem, as this is under your control.

If you could clarify what you want to achieve, it would be easier to answer your questions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
i mean windows temp file,

normally i use config.fpw

and

tmpfiles=<dir>

but i need more control on the location of the temp files, especially the ability to change them mid way in the program.

regarding the why there are always reasons, too complicated to go into at the moment.
 
Prapti,

The setting is stored in the registry, in the Tmpfiles item in this key:
HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\NN\Options

where NN is your VFP version number (e.g. 9.0).

So, to change it programmatically, you only need to alter the value of that key.

However, I still question your reason for doing this. You say you want to change the location of the Windows temp files. But the tmpfiles setting in Config.FPW only affects VFP's own work temp files, in particular, the ones it uses for indexing, and for the code editing. Are those really the temp files that you are interested in?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
the reason for doing what i am doing is a bit complicated, maybe u can suggest a better approach.

sometime back another programmer working for another company managed to get a lot of our data by just accessing our temporary file area.

the consequences were pretty bad for us.

i want to ensure that the temporary file area keeps moving around and not be stationary so that access to that area is made that much more difficult.

maybe my approach is incorrect, maybe u have a better solution for this.
 
Prapti,

That sounds like an unfortunate situation. However, I can only repeat that the directory to which Tmpfiles (in Config.FPW) points does not contain any of your data. It is used internally by VFP.

My guess is that you are creating temporary files of your own -- perhaps cursors containing copies of your data -- and it is these that the intruder has been accessing. These files are usually stored in the current user's private area on a local drive (under Documents and Settings).

My advice would be to make sure that the directories in question are properly secured rather than trying to fool the intruder by moving them around. For example, you should make sure that the user's private directories are never sharable.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
right

so how do i find the location of the cursor.

i did the following experiment

create cursor (something)

sele (something)

?dbf()

this gives me the path of the cursor, but i cant see that file in Windows.
 
mike

another addition to what u said,

u used the word intruder, actually they are not intruders, we have to allow certain people access to our machines because of something called 'courtesy', it is part of a very complicated business tactic difficult to explain here.

to secure the data while giving access to our machine is MY job.
 
Prapti,

so how do i find the location of the cursor.

As I said earlier, this is the user's private temp folder, which is usually under Documents and Settings.

You can find the actual path to the directory in question by doing this:

Code:
SELECT * FROM AnyTable INTO CURSOR Temp NOFILTER
? DBF("Temp")

But, the more you tell me about this issue, the more I am convinced that this is not really a VFP problem. If some unauthorised person is accessing data they shouldn't be, it is a general Windows security issue.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top