Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-17 Thread Anton Shepelev
Felipe Monteiro de Carvalho: If FPC Trunk also does not support this, then I'm sure a patch to improve StringToPPChar would be welcome. I have created issue # 0020279. Anton ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-17 Thread cobines
2011/9/17 Anton Shepelev anton@gmail.com: Felipe Monteiro de Carvalho: If  FPC Trunk also does not support this, then I'm sure a patch to improve  StringToPPChar  would  be welcome. I have created issue # 0020279. If this must be like shell quoting then you also need to allow quoting

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-17 Thread Marco van de Voort
In our previous episode, cobines said: I have created issue # 0020279. If this must be like shell quoting These routines were never meant to be shell quoting (which is silly since it is a Runtime lib call, not a shell). I also don't see the point why it should be expanded to do shell

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Marco van de Voort
In our previous episode, brian said: write a batch file for the actual conversions. What are the commands? mpg321 -q -w tempfile.wav inputfile.mp3 oggenc -Q --output=outputfile.ogg tempfile.wav between the ExecuteProcess and fpSystem calls, I just commented out the one I wasn't

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread michael . vancanneyt
On Fri, 9 Sep 2011, Marco van de Voort wrote: In our previous episode, brian said: write a batch file for the actual conversions. What are the commands? mpg321 -q -w tempfile.wav inputfile.mp3 oggenc -Q --output=outputfile.ogg tempfile.wav between the ExecuteProcess and fpSystem calls, I

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Felipe Monteiro de Carvalho
The quotes are bash commands, they are not part of command line. I wrote on this topic not long ago, but for TProcess: http://wiki.lazarus.freepascal.org/Executing_External_Programs#Parameters_which_contain_spaces_.28Replacing_Shell_Quotes.29 -- Felipe Monteiro de Carvalho

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Anton Shepelev
Andrew Haines: I suspect that the oggenc command is failing because TProcess behind the scenes is splitting --output=outputfile.ogg into two params. Yes, indeed. It is also mentioned on the WIKI: http://wiki.freepascal.org/Executing_External_Programs (see section

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Marco van de Voort
In our previous episode, Anton Shepelev said: TProcess: If the command to be executed or any of the arguments contains whitespace (space, tab character, linefeed character) it should be enclosed in single or double quotes. It should now be possible to

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread brian
On 09/09/2011 04:02 AM, Felipe Monteiro de Carvalho wrote: The quotes are bash commands, they are not part of command line. I wrote on this topic not long ago, but for TProcess:

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Mark Morgan Lloyd
brian wrote: At least IMHO, having to quote the entire parameter string, not just the value, is anything but common whitespace and quote rules. I am pretty sure that I have had to deal with this in the past on unix, writing shell or Perl scripts i.e. not in the context of FPC. It might, in

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Marco van de Voort
In our previous episode, michael.vancann...@wisa.be said: You must remove the quotes around 'outputfile.org': Status:=ExecuteProcess('/path/to/oggenc',['-Q','--output=outputfile.org','tempfile.wav']); While better, this is afaik not required per se, the executing binary can strip them

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Anton Shepelev
Marco van de Voort: It should now be possible to pass the parameters to tprocess separated. I don't remember if that change made it to 2.4.4 though, otherwise it will be in 2.6.0. Thanks for letting me know. Is the parameter separation algorithm intentionally made to split

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Tomas Hajny
On Fri, September 9, 2011 13:40, Marco van de Voort wrote: In our previous episode, michael.vancann...@wisa.be said: You must remove the quotes around 'outputfile.org': Status:=ExecuteProcess('/path/to/oggenc',['-Q','--output=outputfile.org','tempfile.wav']); While better, this is afaik

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Felipe Monteiro de Carvalho
On Fri, Sep 9, 2011 at 1:40 PM, Marco van de Voort mar...@stack.nl wrote: While better, this is afaik not required per se, the executing binary can strip them also while doing cmdline parsing.  It doesn't matter for executeprocess. I wrote that section in the wiki when I had a real issue where

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Jonas Maebe
On 09 Sep 2011, at 13:40, Marco van de Voort wrote: In our previous episode, michael.vancann...@wisa.be said: You must remove the quotes around 'outputfile.org': Status:=ExecuteProcess('/path/to/oggenc',['-Q','-- output=outputfile.org','tempfile.wav']); While better, this is afaik not

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread Felipe Monteiro de Carvalho
On Fri, Sep 9, 2011 at 1:46 PM, Anton Shepelev anton@gmail.com wrote: Is the parameter separation algorithm  intentionally made   to  split  partially  quoted  arguments  like '--file=my  file'?   If  not,  then,   maybe   the StringToPPChar() function should be fixed? It does not split

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-09 Thread michael . vancanneyt
On Fri, 9 Sep 2011, Marco van de Voort wrote: In our previous episode, michael.vancann...@wisa.be said: You must remove the quotes around 'outputfile.org': Status:=ExecuteProcess('/path/to/oggenc',['-Q','--output=outputfile.org','tempfile.wav']); While better, this is afaik not

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Graeme Geldenhuys
I can't really answer you regarding why ExecuteProcess doesn't work. But just wanted to ask: Have you thought of trying TProcess instead? I normally execute any external programs via TProcess with good results - no matter the platform. Regards, - Graeme - On 08/09/2011, brian

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: I can't really answer you regarding why ExecuteProcess doesn't work. But just wanted to ask: Have you thought of trying TProcess instead? I normally execute any external programs via TProcess with good results - no matter the platform. The

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread brian
On 09/08/2011 02:20 AM, Graeme Geldenhuys wrote: I can't really answer you regarding why ExecuteProcess doesn't work. But just wanted to ask: Have you thought of trying TProcess instead? I normally execute any external programs via TProcess with good results - no matter the platform. Nope.

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Marco van de Voort
In our previous episode, brian said: What's driving me crazy is that running the two commands via ExecuteProcess does the first step OK, but oggenc fails with an exit code of 1, operation not permitted. If I replace the ExecuteProcess with a call to fpSystem, concatenating the

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Graeme Geldenhuys
On 08/09/2011, Marco van de Voort wrote: The inner plumbing of executeprocess and tprocess should be the same. TProcess just has several options (shell and piping) I thought of that, right after I sent my message. But maybe there is a slim chance that he is simply not using ExecuteProcess()

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: The inner plumbing of executeprocess and tprocess should be the same. TProcess just has several options (shell and piping) I thought of that, right after I sent my message. But maybe there is a slim chance that he is simply not using

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread michael . vancanneyt
On Wed, 7 Sep 2011, brian wrote: Reinforcing the subject, this is using Linux - to be specific, FPC 2.4.2-0 under 64 bit Mint 9. I'm trying to convert a large number of MP3 files to Ogg Vorbis. This is a two step process, first I run mpg321 to switch them to a .wav file, then oggenc to

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Dimitri Smits
- brian br...@meadows.pair.com schreef: This is reproducible on a whole batch of files, and yes, I've checked all the file permissions. It's got to be something obvious, or some quirk of Linux programming that I haven't met up with yet (I'm still a novice with FreePascal and

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Anton Shepelev
Brian: What's driving me crazy is that running the two commands via ExecuteProcess does the first step OK, but oggenc fails with an exit code of 1, oper- ation not permitted. If I replace the ExecuteProcess with a call to fpSystem, concatenating the CommandString and

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Marco van de Voort
In our previous episode, Anton Shepelev said: In the case of ExecuteProcess() parameter separation takes place on FPC side, while with fpSystem() the shell is responsible for it. Executeprocess has two forms. One does parameter separation, and one not, and directly passes the separated

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread brian
On 09/08/2011 01:07 PM, Marco van de Voort wrote: In our previous episode, Anton Shepelev said: In the case of ExecuteProcess() parameter separation takes place on FPC side, while with fpSystem() the shell is responsible for it. Executeprocess has two forms. One does parameter separation,

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Andrew Haines
On 09/08/11 19:40, brian wrote: What are the commands? mpg321 -q -w tempfile.wav inputfile.mp3 oggenc -Q --output=outputfile.ogg tempfile.wav It makes no difference whether or not I use a full pathname for mpg321 and oggenc, and all the other files are in the current working

Re: [fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-08 Thread Andrew Haines
On 09/08/11 19:52, Andrew Haines wrote: You can try something like oggenc -Q '--output=outputfile.ogg' tempfile.wav to see if that works or if you use TProcess directly I understand that options have been added recently to overcome the problem quotes can have on the arguments. or consider

[fpc-pascal] Linux - ExecuteProcess versus fpSystem

2011-09-07 Thread brian
Reinforcing the subject, this is using Linux - to be specific, FPC 2.4.2-0 under 64 bit Mint 9. I'm trying to convert a large number of MP3 files to Ogg Vorbis. This is a two step process, first I run mpg321 to switch them to a .wav file, then oggenc to convert to a .ogg What's driving me