Permissions Question: Is this possible? [Solved: Apparently not] lazarus / 32-Linux ---------------------------------------------------------------------- minesadorada · 2014-10-27 12:45 I am using CodeTyphoon 5 to compile some applications for Windows 32/64 and Linux 32/64 within a Windows Vista 32-bit environment. All goes well with the compilations, and the Linux and Windows executables are produced without any problems. My question is this: Is there a way to set the permissions/attributes of the produced Linux executables whilst remaining in Windows?  I want the executables to be runnable without me having to reboot into Linux to set the permissions/attributes there. I should mention that I only use Linux for Lazarus development - otherwise I am a Linux dilettante. ---------------------------------------------------------------------- BigChimp · 2014-10-27 12:50 How can you set the permissions for a file that is not on a Linux filesystem? Windows filesystems know nothing of Linux permissions. So... you can't. You can create a script/installer/whatever that sets the permission on linux e.g. something like (by heart): Code: [Select]#/bin/sh # set read, execute for everybody for myprogram chmod ugo+rx myprogram ... but obviously you'd have to run it on the Linux system. ---------------------------------------------------------------------- minesadorada · 2014-10-27 12:53 Thanks Mr. Chimp.  It was worth a try. I know there are utilities to mount ext4 filesystems in Windows out there, so there was a glimmer of hope. No matter, I can reboot into Linux and fix the permissions before deploying. ---------------------------------------------------------------------- BigChimp · 2014-10-27 12:55 One more reason to use an installer/.deb/.rpm package... Because changing permissions is not the only thing - what about changing file owner? On various Linux/Unix systems, the same user name will not have the same mapping (except root, which has uid 0)... ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-27 12:59 Quote from: minesadorada on October 27, 2014, 01:53:37 pmNo matter, I can reboot into Linux and fix the permissions before deploying. I'm sure @BigChimp's suggestion (script/.deb/.rpm) is correct, but continuing your thought of mounting ext4...  Could you follow that up with installing Cygwin and change owner/permissions with that?  Maybe? ---------------------------------------------------------------------- BigChimp · 2014-10-27 13:03 Quote from: Mike.Cornflake on October 27, 2014, 01:59:04 pmI'm sure @BigChimp's suggestion (script/.deb/.rpm) is correct, but continuing your thought of mounting ext4...  Could you follow that up with installing Cygwin and change owner/permissions with that?  Maybe? Nope. Cygwin emulates *nix permissions on Windows, presumably by storing permissions etc in a separate file/database. Copying the file over does not magically copy the permissions.... (edit) ah, unless you use Cygwin scp etc perhaps then it will work... Another option could be to use your virtual machine software's functionality to manipulate the guest. E.g. virtualbox has an API that allows you access to the guest - you could write code to change permissions for arbitrary files that way... Similarly you presumably could script/programmatically set up an ssh session to a running Linux instance and perform those options remotely. See e.g. the code in https://bitbucket.org/rmace/rockfsbuilder However, doesn't BitRock provide the required functionality? ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-27 13:06 Quote from: BigChimp on October 27, 2014, 02:03:18 pmNope. Cygwin emulates *nix permissions on Windows, presumably by storing permissionsetc in a separate file/database. Copying the file over does not magically copy the permissions. Not my understanding.  I thought Cygwin just used the underlying file system.  Thus it has limitations on what it can achieve with fat32 and ntfs, but if you're mounting ext4 anyway... And yeah, I realise this is an aside... ---------------------------------------------------------------------- minesadorada · 2014-10-27 13:12 Quote from: BigChimp on October 27, 2014, 02:03:18 pm... However, doesn't BitRock provide the required functionality? Bitrock compiles Linux executables with permissions intact into the installer - that's not a problem - but it won't automatically set them unless you are running it in the Linux OS. Hence the question... With CodeTyphoon compiling Linux apps happily under Windows, I thought I had the ultimate convenience for MultiPlatfdorm development. Supplementary question:  Can I set Linux 32-bit file permissions in a Linux-64bit OS and vice-versa? If so, all I need to do is get a CodeTyphoon multiplatform setup in Linux 32 or 64, and let it generate Windows executables, where file permissions are not such a problem. The topic can wander now the original question is answered... ---------------------------------------------------------------------- BigChimp · 2014-10-27 13:15 Quote Can I set Linux 32-bit file permissions in a Linux-64bit OS and vice-versa? Yes, the underlying file systems are the same. Quote from: Mike.Cornflake on October 27, 2014, 02:06:48 pmQuote from: BigChimp on October 27, 2014, 02:03:18 pmNope. Cygwin emulates *nix permissions on Windows, presumably by storing permissionsetc in a separate file/database. Copying the file over does not magically copy the permissions. Not my understanding.  I thought Cygwin just used the underlying file system.  Thus it has limitations on what it can achieve with fat32 and ntfs, but if you're mounting ext4 anyway... Yes, seems you're right; however using anything but cygwin to copy the file will still lose the permissions then. He didn't mention he was mounting ext4 - can Cygwin do that? (Another option for OP could be to use a utility to mount the virtual disk image, and modify permissions using that) I'll shut up now with the OT stuff... ---------------------------------------------------------------------- Mike.Cornflake · 2014-10-27 13:26 @minesadorada mentioned ext4 in his second post, and no - I doubt very much that cygwin could handle mounting the filesystem, that would need to be handled independently of Cygwin. And now for something very OT :-) @Blaazen produces excellent results (confirming issues etc) using Lazarus under Linux/Wine.  I've long been thinking about doing the reciprocal, and seeing how well Lazarus runs under Windows/Cygwin.  @minesadorada: I'm suspecting this would help be a part of your ultra convenient cross platform lifestyle :-) Virtual PC's are all very well, but they're still a PITA to use (unless you have three monitors I guess). Still, it's not like I have enough TODO items... ---------------------------------------------------------------------- minesadorada · 2014-10-27 13:39 @Mike - let me know how you get on.. I'm somewhat impressed with CodeTyphoon's ease of cross-compiling, and the IDE generally.  If I can get Windows cross-compiling going in the Linux version (I haven't tried yet) then it becomes a very convenient IDE for multiplatform stuff. I know some folk have got 'standard' Linux Lazarus/fpc to cross- compile Windows successfully, but I just don't have the Linux know-how to make a success of it.  I can barely install just Lazarus on Linux - and that's following the wiki with my finger, slowly.. Thanks Big Chimpster and Mike for your help on this thread..