MacExec not working?

Post Reply
User avatar
plantenkennis
Posts: 151
Joined: Wed Nov 25, 2015 7:13 pm
Location: the Netherlands
Contact:

MacExec not working?

Post by plantenkennis »

Hello group,

I am finally ready with a new update for my program but looking at the next problem:
I my app I have the next line:

Code: Select all

MacExec( "/bin/sh", ResPath()+"/MoveFiles.sh", )
, but on that line the program hangs.
I f I put the next code in terminal it works correct:

Code: Select all

/bin/sh MoveFiles.sh
The respath() is correct. Where should I look at?
Kind regards,

René Koot
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: MacExec not working?

Post by Antonio Linares »

René,

Please try it this way:

MacExec( "/bin/sh " + ResPath() + "/MoveFiles.sh" ) // only one parameter
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
plantenkennis
Posts: 151
Joined: Wed Nov 25, 2015 7:13 pm
Location: the Netherlands
Contact:

Re: MacExec not working?

Post by plantenkennis »

Hello Antonio,

With only 1 parameter it does not work. However I will take another approach:
I used the MacExec to copy files> With the package I distribute I can put new files in folder /Users/shared/. With the 'MoveFiles.sh I move the files from Shared to ˜USER/plantenkennis.

Now I will put the new files in the .app package (Contents/Resourses/Update/) and on start of the program I check if there are files in that folder. Then I copy these files to ˜USER/plantenkennis and delete them from the .app. This way it works perfect and I have a bit more control over the files.

Thanks for all the help.
Kind regards,

René Koot
User avatar
mastintin
Posts: 1502
Joined: Thu May 27, 2010 2:06 pm

Re: MacExec not working?

Post by mastintin »

See this ...
TaskExec parameter 1 -> comandline executable, parameter 2 ->array arguments return-> string result.

Code: Select all

msginfo( TASKEXEC( "/bin/sh",  { ResPath() + "/MoveFiles.sh" } )   )
 
NEW ...
For open file with app -> OPENFILEWITHAPP( Path()+"/testbtn.prg", "Textedit.app")
Post Reply