Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

As a developer, how should I use the special folders in Windows Vista (and Windows 7)?

Where should I save data related to my application? Where should I save configuration files? Where should I save temporary files? Should I do it in "Documents"? "AppData"? Etc...

What is the best practice for saving data to the disk (I guess, best practice for special folders?!)?

like image 392
Nestor Avatar asked Oct 12 '09 18:10

Nestor


People also ask

What are special folder in Windows 7?

On Microsoft Windows, a special folder is a folder that is presented to the user through an interface as an abstract concept instead of an absolute folder path. (The synonymous term shell folder is sometimes used instead.)

How do I create a folder in Windows Vista?

Right-click a blank area on the desktop or in the folder window, point to New, and then click Folder. Type a name for the new folder, and then press ENTER.

What is System special folder?

The system special folders are folders such as Program Files, Programs, System, or Startup, which contain common information. Special folders are set by default by the system, or explicitly by the user, when installing a version of Windows. The Environment.


1 Answers

ApplicationData: Everything that your application needs as "per user" data and does not fall under other categories. Standard configuration files would go here.

CommonApplicationData: Everything that is not "per user" data.

LocalApplicationData: Data that is per user and non-roaming. For example, everything where you want to ENSURE that it is only stored on this machine (like machine activation codes, often also cache/temporary data). Standard temporary files would go here.

MyDocuments: User data that the user actually would identify as "recognizable single documents".

If you don't care about the filename, you can also use a tempfile API to generate a temporary file in the temp directory. You should NOT do this manually. In, for example, .NET you can use Path.GetTempFileName() for that purpose.

like image 182
Foxfire Avatar answered Oct 07 '22 18:10

Foxfire