Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Preserving file permissions
dmoore:
Thanks for taking a look.
Isn't the platform stuff for runtime checks? We need a compile time check.
I put the function arg in for the case that we don't want to preserve permissions for SaveAs - but need to add the code. Maybe a better way is to have a wxString permissions_from argument, which is the file to take permissions from?
Cygwin should be fine I would think. Does OS X have stat? (And that's __wxMAC__ or something anyway isn't it, which isn't in the patch)
oBFusCATed:
OSX is based on FreeBSD, so it is unix - thus most of the posix apis should work just fine.
But you're correct that the platform stuff is runtime only.
The wxString permissinsFrom parameter sounds fine to me.
dmoore:
Ping. Anyone have any thoughts on what is the right #ifdef to use to detect systems with stat?
oBFusCATed:
Probably some of these: http://stackoverflow.com/questions/5919996/how-to-detect-reliably-mac-os-x-ios-linux-windows-in-c-preprocessor
I'd probably use __posix.
dmoore:
Thanks for the links.
This is hilariously comprehensive: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
I saw answers like this in a couple of places: http://stackoverflow.com/a/16107549/748925 so maybe this is better than __posix?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version