1 | function dumpPathOfProperty(prop)
|
---|
2 | {
|
---|
3 | dump(prop +' = ');
|
---|
4 |
|
---|
5 | try
|
---|
6 | {
|
---|
7 | var file = dsprops.get(prop, Components.interfaces.nsIFile);
|
---|
8 | dump(file.path + '\n');
|
---|
9 | }
|
---|
10 | catch (ar)
|
---|
11 | {
|
---|
12 | dump('undefined or error \n');
|
---|
13 | }
|
---|
14 | }
|
---|
15 |
|
---|
16 | var dscontractid = "@mozilla.org/file/directory_service;1"; // XXX old-style
|
---|
17 | var ds = Components.classes[dscontractid].getService();
|
---|
18 | var dsprops = ds.QueryInterface(Components.interfaces.nsIProperties);
|
---|
19 |
|
---|
20 | dump("xpcom locations::\n");
|
---|
21 | // XPCOM Locations:
|
---|
22 | dumpPathOfProperty ("xpcom.currentProcess");
|
---|
23 | dumpPathOfProperty ("xpcom.currentProcess.componentRegistry");
|
---|
24 | dumpPathOfProperty ("xpcom.currentProcess.componentDirectory");
|
---|
25 | dumpPathOfProperty ("system.OS_DriveDirectory");
|
---|
26 | dumpPathOfProperty ("system.OS_TemporaryDirectory");
|
---|
27 | dumpPathOfProperty ("system.OS_CurrentProcessDirectory");
|
---|
28 | dumpPathOfProperty ("system.OS_CurrentWorkingDirectory");
|
---|
29 |
|
---|
30 | dump("Mac locations::\n");
|
---|
31 | // Mac
|
---|
32 | dumpPathOfProperty ("system.SystemDirectory");
|
---|
33 | dumpPathOfProperty ("system.DesktopDirectory");
|
---|
34 | dumpPathOfProperty ("system.TrashDirectory");
|
---|
35 | dumpPathOfProperty ("system.StartupDirectory");
|
---|
36 | dumpPathOfProperty ("system.ShutdownDirectory");
|
---|
37 | dumpPathOfProperty ("system.AppleMenuDirectory");
|
---|
38 | dumpPathOfProperty ("system.ControlPanelDirectory");
|
---|
39 | dumpPathOfProperty ("system.ExtensionDirectory");
|
---|
40 | dumpPathOfProperty ("system.FontsDirectory");
|
---|
41 | dumpPathOfProperty ("system.PreferencesDirectory");
|
---|
42 | dumpPathOfProperty ("system.DocumentsDirectory");
|
---|
43 | dumpPathOfProperty ("system.InternetSearchDirectory");
|
---|
44 |
|
---|
45 | dump("PC locations::\n");
|
---|
46 | // PC
|
---|
47 | dumpPathOfProperty ("system.SystemDirectory");
|
---|
48 | dumpPathOfProperty ("system.WindowsDirectory");
|
---|
49 | dumpPathOfProperty ("system.HomeDirectory");
|
---|
50 | dumpPathOfProperty ("system.Desktop");
|
---|
51 | dumpPathOfProperty ("system.Programs");
|
---|
52 | dumpPathOfProperty ("system.Controls");
|
---|
53 | dumpPathOfProperty ("system.Printers");
|
---|
54 | dumpPathOfProperty ("system.Personal");
|
---|
55 | dumpPathOfProperty ("system.Favorites");
|
---|
56 | dumpPathOfProperty ("system.Startup");
|
---|
57 | dumpPathOfProperty ("system.Recent");
|
---|
58 | dumpPathOfProperty ("system.Sendto");
|
---|
59 | dumpPathOfProperty ("system.Bitbucket");
|
---|
60 | dumpPathOfProperty ("system.Startmenu");
|
---|
61 | dumpPathOfProperty ("system.Desktopdirectory");
|
---|
62 | dumpPathOfProperty ("system.Drives");
|
---|
63 | dumpPathOfProperty ("system.Network");
|
---|
64 | dumpPathOfProperty ("system.Nethood");
|
---|
65 | dumpPathOfProperty ("system.Fonts");
|
---|
66 | dumpPathOfProperty ("system.Templates");
|
---|
67 | dumpPathOfProperty ("system.Common_Startmenu");
|
---|
68 | dumpPathOfProperty ("system.Common_Programs");
|
---|
69 | dumpPathOfProperty ("system.Common_Startup");
|
---|
70 | dumpPathOfProperty ("system.Common_Desktopdirectory");
|
---|
71 | dumpPathOfProperty ("system.Appdata");
|
---|
72 | dumpPathOfProperty ("system.Printhood");
|
---|
73 |
|
---|
74 | dump("Unix locations::\n");
|
---|
75 | // Unix
|
---|
76 |
|
---|
77 | dumpPathOfProperty ("system.LocalDirectory");
|
---|
78 | dumpPathOfProperty ("system.LibDirectory");
|
---|
79 | dumpPathOfProperty ("system.HomeDirectory");
|
---|
80 |
|
---|
81 | dump("Beos locations::\n");
|
---|
82 | // Beos
|
---|
83 |
|
---|
84 | dumpPathOfProperty ("system.SettingsDirectory");
|
---|
85 | dumpPathOfProperty ("system.HomeDirectory");
|
---|
86 | dumpPathOfProperty ("system.DesktopDirectory");
|
---|
87 | dumpPathOfProperty ("system.SystemDirectory");
|
---|
88 |
|
---|
89 | dump("OS2 locations::\n");
|
---|
90 | // OS2
|
---|
91 | dumpPathOfProperty ("system.SystemDirectory");
|
---|
92 | dumpPathOfProperty ("system.OS2Directory");
|
---|
93 | dumpPathOfProperty ("system.DesktopDirectory");
|
---|
94 |
|
---|
95 |
|
---|
96 | // XPFE locations:
|
---|
97 |
|
---|
98 |
|
---|
99 | // application Directories:
|
---|
100 | dumpPathOfProperty ("app.res.directory");
|
---|
101 | dumpPathOfProperty ("app.defaults.directory");
|
---|
102 | dumpPathOfProperty ("app.chrome.directory");
|
---|
103 | dumpPathOfProperty ("app.chrome.user.directory");
|
---|
104 | dumpPathOfProperty ("app.plugins.directory");
|
---|
105 |
|
---|
106 | // application Files:
|
---|
107 |
|
---|
108 | dumpPathOfProperty ("app.registry.file.4");
|
---|
109 | dumpPathOfProperty ("app.registry.file.5");
|
---|
110 | dumpPathOfProperty ("app.local.store.file.5");
|
---|
111 | dumpPathOfProperty ("app.history.file.5");
|
---|
112 | dumpPathOfProperty ("app.user.panels.5");
|
---|
113 |
|
---|
114 | // Preferences:
|
---|
115 |
|
---|
116 | // dumpPathOfProperty ("app.prefs.directory.3");
|
---|
117 | // dumpPathOfProperty ("app.prefs.directory.4");
|
---|
118 | dumpPathOfProperty ("app.prefs.directory.5");
|
---|
119 | dumpPathOfProperty ("app.pref.default.directory.5");
|
---|
120 |
|
---|
121 | // dumpPathOfProperty ("app.prefs.file.3");
|
---|
122 | // dumpPathOfProperty ("app.prefs.file.4");
|
---|
123 | dumpPathOfProperty ("app.prefs.file.5");
|
---|
124 |
|
---|
125 | // Profile:
|
---|
126 |
|
---|
127 | // dumpPathOfProperty ("app.profile.user.directory.3");
|
---|
128 | // dumpPathOfProperty ("app.profile.user.directory.4");
|
---|
129 | dumpPathOfProperty ("app.profile.user.directory.5");
|
---|
130 | // dumpPathOfProperty ("app.profile.default.user.directory.3");
|
---|
131 | // dumpPathOfProperty ("app.profile.default.user.directory.4");
|
---|
132 | dumpPathOfProperty ("app.profile.default.user.directory.5");
|
---|
133 | // dumpPathOfProperty ("app.profile.defaults.directory.3");
|
---|
134 | // dumpPathOfProperty ("app.profile.defaults.directory.4");
|
---|
135 | dumpPathOfProperty ("app.profile.defaults.directory.5");
|
---|
136 |
|
---|
137 |
|
---|
138 |
|
---|
139 | // Bookmarks:
|
---|
140 |
|
---|
141 | // dumpPathOfProperty ("app.bookmark.file.3");
|
---|
142 | // dumpPathOfProperty ("app.bookmark.file.4");
|
---|
143 | dumpPathOfProperty ("app.bookmark.file.5");
|
---|
144 |
|
---|
145 | // Search
|
---|
146 | dumpPathOfProperty ("app.search.file.5");
|
---|
147 | dumpPathOfProperty ("app.search.directory.5");
|
---|
148 |
|
---|
149 |
|
---|
150 | // MailNews:
|
---|
151 |
|
---|
152 | dumpPathOfProperty ("app.mail.directory.5");
|
---|
153 | dumpPathOfProperty ("app.mail.imap.directory.5");
|
---|
154 | dumpPathOfProperty ("app.mail.news.directory.5");
|
---|
155 | dumpPathOfProperty ("app.mail.messenger.cache.directory.5");
|
---|