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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Temp files on Vista

Status
Not open for further replies.

adit39

Technical User
May 6, 2006
26
US
Our app currently creates temp files on root of C Drive.
Running on Vista results in "access denied" error. It appears the C:\ is a protected area. I can rewrite the app to place temp files in different location but would like to avoid doing so. My end users are typically not very computer savvy and will get lost in the Vista Permissions and Access setups. At this point it appears not many users are Vista savvy YET. Any comments and/or suggestions greatly appreciated.
 
Creating temp files in the root C drive souns like a really bad idea to me. Why not create special temp folder? This way you can always clean up after yourself.
 
One suggestion: NEVER create a TEMP files in the root of the disk! NEVER!
You could create temp files in some sub-folder in the C:\ lets name it MyTemp. Then you could create a CONFIG.FPW file and put this line in it:

TEMP=C:\MYTEMP

In the beginning of your main program:
Code:
IF NOT DIRECTORY([C:\MYTEMP])
   md C:\MYTEMP
ENDIF

Just don't forget to distibute that CONFIG.FOW with your application or just BUILD it in the EXE.


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
Adit39,

I know this is a case of being wise after the event, but Ilyad and Borislav are completely correct. The root of the C drive is no place for ad hoc temporary files.

In addition, it's a bad idea to hard code any path or file location. You just never know when you might need to change it.

In this case, if these are genuinely temporary files, I suggest you use SYS(2023) to determine where to put them. That has the big advantage that they will be automatically deleted by the Windows disk cleanup tool if, for any reason, your application doesn't delete them itself.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks All,
I guess I'll have the code changed next time we update.
For now, I'll have Vista users gain access to C:\ which is
where out temp DBS go now.
TD
 
I'm not sure Vista users will be able to get write access to C:\. I've been experimenting with Vista and find that when it believes a folder isn't write-able, it really isn't.

Tamar
 
Tamar,
So far, thats what we have heard. I have seen many threads about gaining access by changing various security and permssion settings but so far looks very confusing and more than I can ask or expect of our typical end users. I guess I'll need to get a Vista CPU soon to familiarize myself further. I was hoping to hold out until they release some inevitable SPs and more drivers, etc. become available. I've read there are already seven versions of Vista ?? Feedback so far is Vista is very consumer friendly with all that is pre-loaded but problematic for users who need more than what comes in the box. Once again, we and the entire industry have to play catch up to Microsoft.
Thanks,
TD
 

If you want to share your C:\ drive in Vista with other network machines, simply enabling sharing is not enough.

A workaround is to add the Vista guest account to the group and user names list in the Security tab for the C:\ drive and give the guest account full permissions.

Have Vista but yet to install VFP on the machine but the above enables access from anywhere on the network.

Might be worth trying the workaround to enable local read/write access to C:\ drive subfolders as well as the C:\ drive public folders.

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Thanks Chris,
Your workaround would work for The C Root and any other protected folder such as program files BUT it would be necessary to walk each end user through the security tweaks which I want to avoid. I believe the workaround is not necessary if we setup and use only our own app folders
and avoid the protected areas. Probably best to do so anyway for security reasons, especially since our typical end user is not very computer savvy.
TD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top