[OSX] Replacing the executable
BlitzMax Forums/BlitzMax Beginners Area/[OSX] Replacing the executable
| ||
Hello everybody, I am about to write an updater for a programme of mine. The updater downloads an update-file from my server that has packed all files I want to replace and executes a simple script. Now all works file apart from the executable (programme.app/Contents/MacOS/programme), that MacOS doesn't accept as a binary file: it says its plain text. What can I do in this case? How can I set the type of that file so that it becomes a normal executable? Many thanks in advance Simon |
| ||
Hmm, might be something to do with the way in which it was downloaded, you need to download a binary stream rather than text? |
| ||
I don't think so actually. The file that is downloaded includes all files and the updater itself extract the data and saves them in a file. I guess I have to change the filetype after I finished saving all data in that file. |
| ||
chmod +x the_file ;-) |
| ||
Hi Brucey, I just found out myself. Many thanks indeed anyway. I found a solution in the net that used SetFile but it doesn't seem to work. Greetings Simon |
| ||
BRL.FileSystem has the SetFileMode() method... so perhaps something like SetFileMode("the_file", 1877) where 1877 = 0x755 = rwxr-xr-x (owner rwx, group rx, other rx) |
| ||
Hmm... I now use the standart UNIX-command system_("chmod +x filename"). Works perfectly. |