Folder Paths Win Mac

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
  
 
{| class="wikitable"
 
{| class="wikitable"
! Enum !! Name !! Mac OS X 10.6.8 (Snow Leopard) !! Windows 7 64-bit
+
{{OSFolder| id=0 | name=Desktop | osx1068=/Users/yourname/Desktop | win7=C:\Users\yourname\Desktop }}
|-
+
{{OSFolder| id=2 | name=Programs | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs }}
| 0 || Desktop || /Users/yourname/Desktop || C:\Users\yourname\Desktop
+
{{OSFolder| id=5 | name=Personal | osx1068=/Users/yourname | win7=C:\Users\yourname\Documents }}
|-
+
{{OSFolder| id=5 | name=MyDocuments | osx1068=/Users/yourname | win7=C:\Users\yourname\Documents }}
| 2 || Programs||  || C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
+
{{OSFolder| id=6 | name=Favorites | osx1068=/Users/yourname/Library/Favorites | win7=C:\Users\yourname\Favorites }}
|-
+
{{OSFolder| id=7 | name=Startup | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup }}
| 5 || Personal|| /Users/yourname || C:\Users\yourname\Documents
+
{{OSFolder| id=8 | name=Recent | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Recent }}
|-
+
{{OSFolder| id=9 | name=SendTo | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\SendTo }}
| 5 || MyDocuments|| /Users/yourname || C:\Users\yourname\Documents
+
{{OSFolder| id=11 | name=StartMenu | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu }}
|-
+
{{OSFolder| id=13 | name=MyMusic | osx1068=/Users/yourname/Music | win7=C:\Users\yourname\Music }}
| 6 || Favorites|| /Users/yourname/Library/Favorites || C:\Users\yourname\Favorites
+
{{OSFolder| id=16 | name=DesktopDirectory | osx1068=/Users/yourname/Desktop | win7=C:\Users\yourname\Desktop }}
|-
+
{{OSFolder| id=17 | name=MyComputer }}
| 7 || Startup||  || C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
+
{{OSFolder| id=21 | name=Templates | osx1068=/Users/yourname/Templates | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Templates }}
|-
+
{{OSFolder| id=26 | name=ApplicationData | osx1068=/Users/yourname/.config | win7=C:\Users\yourname\AppData\Roaming }}
| 8 || Recent||  || C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Recent
+
{{OSFolder| id=28 | name=LocalApplicationData | osx1068=/Applications/Unity/MonoDevelop.app/Contents/MacOS/../Frameworks/Mono.framework/Versions/Current/share | win7=C:\Users\yourname\AppData\Local }}
|-
+
{{OSFolder| id=32 | name=InternetCache | osx1068=/Users/yourname/Library/Caches | win7=C:\Users\yourname\AppData\Local\Microsoft\Windows\Temporary Internet Files }}
| 9 || SendTo||  || C:\Users\yourname\AppData\Roaming\Microsoft\Windows\SendTo
+
{{OSFolder| id=33 | name=Cookies | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Cookies }}
|-
+
{{OSFolder| id=34 | name=History | win7=C:\Users\yourname\AppData\Local\Microsoft\Windows\History }}
| 11 || StartMenu||  || C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu
+
{{OSFolder| id=35 | name=CommonApplicationData | osx1068=/usr/share | win7=C:\ProgramData }}
|-
+
{{OSFolder| id=37 | name=System | win7=C:\Windows\system32 }}
| 13 || MyMusic|| /Users/yourname/Music || C:\Users\yourname\Music
+
{{OSFolder| id=38 | name=ProgramFiles | osx1068=/Applications | win7=C:\Program Files<br/>''or'' C:\Program Files (x86) }}
|-
+
{{OSFolder| id=39 | name=MyPictures | osx1068=/Users/yourname/Pictures | win7=C:\Users\yourname\Pictures }}
| 16 || DesktopDirectory|| /Users/yourname/Desktop || C:\Users\yourname\Desktop
+
{{OSFolder| id=43 | name=CommonProgramFiles | win7=C:\Program Files\Common Files<br/>''or'' C:\Program Files (x86)\Common Files }}
|-
+
| 17 || MyComputer||  ||
+
|-
+
| 21 || Templates|| /Users/yourname/Templates || C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Templates
+
|-
+
| 26 || ApplicationData|| /Users/yourname/.config || C:\Users\yourname\AppData\Roaming
+
|-
+
| 28 || LocalApplicationData|| /Applications/Unity/MonoDevelop.app/Contents/MacOS/../Frameworks/Mono.framework/Versions/Current/share || C:\Users\yourname\AppData\Local
+
|-
+
| 32 || InternetCache|| /Users/yourname/Library/Caches || C:\Users\yourname\AppData\Local\Microsoft\Windows\Temporary Internet Files
+
|-
+
| 33 || Cookies||  || C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Cookies
+
|-
+
| 34 || History||  || C:\Users\yourname\AppData\Local\Microsoft\Windows\History
+
|-
+
| 35 || CommonApplicationData|| /usr/share || C:\ProgramData
+
|-
+
| 37 || System||  || C:\Windows\system32
+
|-
+
| 38 || ProgramFiles|| /Applications || C:\Program Files<br/>or C:\Program Files (x86)
+
|-
+
| 39 || MyPictures|| /Users/yourname/Pictures || C:\Users\yourname\Pictures
+
|-
+
| 43 || CommonProgramFiles||  || C:\Program Files\Common Files<br/>or C:\Program Files (x86)\Common Files
+
 
|}
 
|}
  

Revision as of 11:21, 18 February 2012

Here is a list of the system paths you can retrieve using System.Environment.SpecialFolder( #name goes here# ):


Desktop (0)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Desktop
Windows7.gif Windows 7 C:\Users\yourname\Desktop

Programs (2)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs

Personal (5)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname
Windows7.gif Windows 7 C:\Users\yourname\Documents

MyDocuments (5)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname
Windows7.gif Windows 7 C:\Users\yourname\Documents

Favorites (6)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Library/Favorites
Windows7.gif Windows 7 C:\Users\yourname\Favorites

Startup (7)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Recent (8)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Recent

SendTo (9)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\SendTo

StartMenu (11)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu

MyMusic (13)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Music
Windows7.gif Windows 7 C:\Users\yourname\Music

DesktopDirectory (16)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Desktop
Windows7.gif Windows 7 C:\Users\yourname\Desktop

MyComputer (17)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 n/a

Templates (21)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Templates
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Templates

ApplicationData (26)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/.config
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming

LocalApplicationData (28)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Applications/Unity/MonoDevelop.app/Contents/MacOS/../Frameworks/Mono.framework/Versions/Current/share
Windows7.gif Windows 7 C:\Users\yourname\AppData\Local

InternetCache (32)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Library/Caches
Windows7.gif Windows 7 C:\Users\yourname\AppData\Local\Microsoft\Windows\Temporary Internet Files

Cookies (33)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Cookies

History (34)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Local\Microsoft\Windows\History

CommonApplicationData (35)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /usr/share
Windows7.gif Windows 7 C:\ProgramData

System (37)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Windows\system32

ProgramFiles (38)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Applications
Windows7.gif Windows 7 C:\Program Files
or C:\Program Files (x86)

MyPictures (39)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Pictures
Windows7.gif Windows 7 C:\Users\yourname\Pictures

CommonProgramFiles (43)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Program Files\Common Files
or C:\Program Files (x86)\Common Files

Code

Stand-alone

using System;
 
class Test
{
	static int Main(String[] argv)
	{
		var names = Enum.GetNames(typeof(Environment.SpecialFolder));
		var values = Enum.GetValues(typeof(Environment.SpecialFolder));
		for(int i = 0; i < names.Length; ++i)
			Console.WriteLine("{0} {1}: {2}", (int)values.GetValue(i), names[i], Environment.GetFolderPath((Environment.SpecialFolder)values.GetValue(i)));
 
		return 0;
	}
}


Inside Unity

var names = System.Enum.GetNames( typeof( System.Environment.SpecialFolder ) );
var values = System.Enum.GetValues( typeof( System.Environment.SpecialFolder ) );
for( int i = 0; i < names.Length; ++i )
    Debug.Log( (int)values.GetValue( i ) + " " + names[i] + ": " + System.Environment.GetFolderPath( (System.Environment.SpecialFolder)values.GetValue( i ) ) );


Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox