You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This xtd example demonstrates how to retrieve special folders in a fully cross-platform way.
124
+
* With just three lines of code, we can get Desktop, Home, or Program Files without any platform-specific calls or `#ifdef` logic.
125
+
* It highlights xtd’s simplicity and unified API compared to Win32 and Qt.
126
+
61
127
## Conclusion
62
128
129
+
Whether you use Win32, Qt or xtd, it is always possible to get the special folders.
130
+
The main difference lies in:
131
+
* Win32 : verbose, sometimes deprecated API, manual management of special cases (such as Home).
132
+
* Qt : simplifies some folders (Home, Desktop) but still requires system calls for others (Program Files).
133
+
* Xtd : unified, cross-platform, clear and readable approach, without #ifdef or explicit native calls.
134
+
135
+
With xtd, the focus is on the essentials: writing code that works everywhere, without worrying about the implementation details specific to each OS.
63
136
64
137
> **Did you know?**
65
138
>
66
-
>
139
+
> * On Windows, the `Program Files` folder can change depending on the system language or if the user has moved it.
140
+
> * On macOS, the concept of `Program Files` does not exist: the convention wants applications to be in `/Applications`.
141
+
> * On Linux, there is no strict equivalent: `/opt` and `/usr/local` are often used for third-party applications.
142
+
> *[xtd::environment::get_folder_path](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1environment.html#a465e71972e122d4bbdaa943ae02d4cd8) automatically manages these particularities according to the platform.
67
143
68
144
## To go further
69
145
146
+
* See [xtd::environment::special_folder](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1environment.html#a2fb2b59eded52f8745b88b44ae9e7057) documentation.
147
+
* The following code shows how to simple combine path with special folder using [xtd::io::path::combine](https://gammasoft71.github.io/xtd/reference_guides/latest/classxtd_1_1io_1_1path.html#ae64bf12dad2f160ad85a951b9d011023) :
0 commit comments