OS X - how to write to a file associated as a Unix executable
Glen Bojsza
gbojsza at gmail.com
Mon Feb 29 19:09:48 EST 2016
This only works IF the file created is associated with the terminal
application.
The issue is creating the proper file format so when the chmod creates it
as Unix executable.
On Mon, Feb 29, 2016 at 7:06 PM, Warren Samples <warren at warrensweb.us>
wrote:
> On 02/29/2016 03:13 PM, Glen Bojsza wrote:
>
>> Hello,
>>
>> I am trying to write the from a text field to a file and then change the
>> file so it is executable.
>>
>> put field "mytest" into URL "binfile:~/race"
>> or
>> put field "mytest" into URL"file:~/race"
>>
>> The file race is created in either case but are associated with textedit.
>>
>> I require it to be recognized as a Unix executable associated with the
>> terminal application once I have done a chmod +rx on it
>>
>> If I just save a file from textmate and do a chmod +rx then it works.
>>
>> So it has to do with how I am saving it out of LC.
>>
>> Any suggestions?
>>
>> thanks,
>>
>> Glen
>>
>
>
> You could look into fileType in the dictionary. I can recall having to
> explicitly set the file type for images saved from LiveCode or they would
> open in an editor because LiveCode was saving them as text files.
>
> You could also try using 'get shell()' and whatever command or method you
> feel most appropriate given you content, to create the file and then make
> it executable by
>
> 'get shell("chomd +x /your/new/file")'
>
> This works here under Linux and <should> work under OS X because the file
> itself is being created and saved by the system instead of by LiveCode.
>
>
> Warren
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list