The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

CISDL_ ? for temporary files

I am working on a revised 'email send generated pdf document'  module for my application, and I want to put these files to be attached in an appropriate folder. The app may be run someday on Citrix or Term services, so I need to choose correctly.

I was looking through the CISDL_constants and didn't see anything resembling a CISDL_TEMP - so I am thinking I should just use CSIDL_APPDATA, and create a folder under there that can be cleaned out at the start/end of a session by the app.

Is this the best way to go for temp files? $CSIDL_APPDATA\MyApp\MyTemp\?
Jason T
Friday, September 28, 2007
 
 
Nevermind!

After a bit of reading and looking around, I came to the conclusion that CSIDL_APPDATA\MyApp\Temp is the best place to put my application's temp files on XP, and presumably Vista. They don't need to roam, and all the other user settings and files can go in C:\Documents and Settings\jthibodeau\Application Data\MyApp\, that seems to be how most of the other software from well-known companies is working.
Jason T
Monday, October 01, 2007
 
 
The Windows SDK has a function to help you out - GetTempPath.  This gives you the official Windows temporary file location, and you can create subfolders under it if needed.  You didn't say which language you're using, but I think the SDK is reachable from just about any language.

I hope Vista hasn't restricted access to the folder, I'm not up on all the latest gotcha's.
Mark Ransom Send private email
Wednesday, October 03, 2007
 
 
Thanks for the reply - I know this old API GetWindowsTemp, I have used it in the past. I was wondering too if that isn't deprecated in Vista. I don't have one to test on yet. My apps are often published to our Citrix servers, or run via terminal server with reduced access accounts - I have to be certain of where I put files, and if they are unique to the user/session... and be certain that they user will have rights to write/create files in a folder.

In one of our software, we have a system that was using GetWindowsTemp - and we allowed it to be overridden by a parameter in the user profile. In some places we used a \\[server]\[user] folder, in other places we had a drive letter assigned to each user that was a unique location.

These are good for in-house managed systems, we have the flexibility to change them, but for packages that might wind up installed 'out there'... I want to make sure to do things right, using 'standards'.

It seems ludicrous that GetWindowsTemp would return a folder (on any OS version) that was not a writable location, but you never know... does anyone know?
Jason T
Tuesday, October 09, 2007
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz