Proposal for "System_Folders"

» Metadata » Status
» Description
Calculates or guesses the location of system folders like temp, desktop and others.

This is needed especially in Desktop applications (e.g. PHP-Gtk ones) that want to create a file in the "Desktop" folder, or for applications that want to know the directory under which application specific data (like config options) can be stored. While this is easy in *nix (just use "~"), it's harder for Windows: You need to get the AppData path which is most times under "C:\Documents and settings\$username\Application Data\" or so.

This package solves that problem in a system-independent way.

It allows you to get the locations of the following directories:
'Home' => getHome(),
'Documents' => getDocuments(),
'Shared documents' => getSharedDocuments(),
'Temp' => getTemp(),
'Desktop' => getDesktop(),
'AppData' => getAppData(),
'Programs' => getPrograms(),
'Windows' => getWindows()

You can use System_Folders_Cached to save and store the directory settings in an ini-file. This allows you to customize the folder locations.
» Dependencies » Links
  • Config
» Timeline » Changelog
  • First Draft: 2006-02-01
  • Proposal: 2006-02-01
  • Call for Votes: 2006-03-02
  • Christian Weiske
    [2006-02-16 08:03 UTC]

    - Fixed environment variable on windows and php5
    - Fixed example to include the right path
  • Christian Weiske
    [2006-02-18 07:14 UTC]

    - Customizable folders via System_Folders_Cached
    - Some Mac support
    - More translated directories
  • Christian Weiske
    [2006-02-19 09:56 UTC]

    - Mac username and home dir support
  • Christian Weiske
    [2006-03-02 22:21 UTC]

    Calling for votes, as it works on macs. too.