Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-05

Console application in Mac OS X 10.5

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Roland Turcan

Hello lazarus project!

I have created a small application which I use to exchange files before the main application starts and afterwards it starts the main one.

I have two question:

1. ExecuteProcess function waits until executed application ends, but I don't need to wait. Which function is intended to start process and continue?

2. When I call "./myapp.app/Contents/MacOS/myapp" from terminal, then the small helper starts, does its job and starts the main one. When I try to start application using double click on myapp.app directory, then I see one flicker in taskbar, but the application doesn't start. When I exchange the files, that main has the same name as helper one, then application starts.

I can find this error in system.log:

May 25 16:11:46 tests-mac-mini [0x0-0x1fb1fb].com.company.myapp[42167]: exception at 00000000: May 25 16:11:46 tests-mac-mini [0x0-0x1fb1fb].com.company.myapp[42167]: Invalid option at position 1: "p".

It is not related to permissions, because both executables have execution flag.

What could I check.

Reply by email

Mattias Gaertner
to Roland Turcan
Show quoted text 28 lines
Hello lazarus project! I have created a small application which I use to exchange files before the main application starts and afterwards it starts the main one. I have two question: 1. ExecuteProcess function waits until executed application ends, but I don't need to wait. Which function is intended to start process and continue? 2. When I call "./myapp.app/Contents/MacOS/myapp" from terminal, then the small helper starts, does its job and starts the main one. When I try to start application using double click on myapp.app directory, then I see one flicker in taskbar, but the application doesn't start. When I exchange the files, that main has the same name as helper one, then application starts. I can find this error in system.log: May 25 16:11:46 tests-mac-mini [0x0-0x1fb1fb].com.company.myapp[42167]: exception at 00000000: May 25 16:11:46 tests-mac-mini [0x0-0x1fb1fb].com.company.myapp[42167]: Invalid option at position 1: "p". It is not related to permissions, because both executables have execution flag.

The "Invalid option at position" looks like the error message of the CheckOptions method.
Maybe you forgot to add p to the allowed options?

What could I check.

Mattias

Reply by email

Roland Turcan
to Mattias Gaertner

<<< 26.5.2009 18:46 - Mattias Gaertner "" >>>

Show quoted text 7 lines
> May 25 16:11:46 tests-mac-mini > [0x0-0x1fb1fb].com.company.myapp[42167]: exception at 00000000: May > 25 16:11:46 tests-mac-mini [0x0-0x1fb1fb].com.company.myapp[42167]: > Invalid option at position 1: "p". > > It is not related to permissions, because both executables have > execution flag.

MG> The "Invalid option at position" looks like the error message of MG> the CheckOptions method.
MG> Maybe you forgot to add p to the allowed options?

I didn't need to use any command line options, but it is true that I left the parsing of command line inside. Because my testing were executed from IDE or from terminal I didn't have any problem and therefore I kept the parser inside just for the future.

Thanks for perfect hint, because I removed the parser and it works fine.

Mattias, you are the king which saved my ass again. Thank you very much. :)

Reply by email