MacExec not working?

MacExec not working?

Postby plantenkennis » Fri Nov 02, 2018 3:54 pm

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  Expand view  RUN
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  Expand view  RUN
/bin/sh MoveFiles.sh


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

René Koot
User avatar
plantenkennis
 
Posts: 166
Joined: Wed Nov 25, 2015 7:13 pm
Location: the Netherlands

Re: MacExec not working?

Postby Antonio Linares » Sat Nov 03, 2018 9:48 am

René,

Please try it this way:

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42117
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: MacExec not working?

Postby plantenkennis » Sun Nov 04, 2018 9:31 am

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
plantenkennis
 
Posts: 166
Joined: Wed Nov 25, 2015 7:13 pm
Location: the Netherlands

Re: MacExec not working?

Postby mastintin » Mon Nov 05, 2018 8:05 pm

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

Code: Select all  Expand view  RUN

msginfo( TASKEXEC( "/bin/sh",  { ResPath() + "/MoveFiles.sh" } )   )
 


NEW ...
For open file with app -> OPENFILEWITHAPP( Path()+"/testbtn.prg", "Textedit.app")
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm


Return to FiveMac / FivePhone (iPhone, iPad)

Who is online

Users browsing this forum: No registered users and 0 guests