Was going through the Filezilla source code and came to this line:
int systemFolders[3] = {CSIDL_PERSONAL, CSIDL_DRIVES, CSIDL_NETWORK};
I searched the project and couldn’t find these variables being declared as ints.
I looked up CSIDL_PERSONAL and it seems to be some kind of system variable for Windows.
So why are they ints?
Edit: If it’s a path variable, why is it a number?
CSIDLs are numerical identifiers (probably
#defines, whose type isint) used to refer to some particular system folders on Windows.To get the path/shell location they refer to have to you have to use some shell function, typically SHGetSpecialFolderPath. The CSIDL are used to specify whose special folder you want to get the path; the alternative would be to have a separated function for each special folder, which is cumbersome and quite a waste of code.
It’s very important to use such method to retrieve the position of special folders instead of hardcoding them, because the position of many of them can be customized/is different for each user (think e.g. at the Documents folder).