proc:system

Wednesday, 13 November 2019 · 6 messages
GC
Giuseppe G. A. Celano13 Nov 2019 11:33 #
Hi, When I try to run
proc:system("/usr/local/bin/tesseract") I get the error [proc:code0001]
Similarly:
proc:system("tesseract") returns [proc:error] Cannot run program "tesseract": error=2, No such file or directory
Similarly:
proc:system("tesseract", (), map {"dir" : "/usr/local/bin/"}) returns [proc:error] Cannot run program "tesseract" (in directory "/usr/local/bin"): error=2, No such file or directory
The command "tesseract" works at the command line. I suspect there may be a problem with permissions: is there a way to overcome this error? Thanks. Best, Giuseppe
CG
Christian Grün13 Nov 2019 17:50 #
Hi Giuseppe,
Quoted text · Giuseppe G. A. Celano · 2 lines
> When I try to run > proc:system("/usr/local/bin/tesseract") I get the error [proc:code0001]
On my system, I get the (expected) error… [proc:error] Cannot run program "/usr/local/bin/tesseract": CreateProcess error=2, Das System kann die angegebene Datei nicht finden …so we may need to find out what code 1 means in your case. Could you run the query with debugging enabled and pass us on the stack trace? And your error code indicates that you are using an older version of BaseX. Does it work with a more recent version? If not, what do you get? Best, Christian
Quoted text · Giuseppe G. A. Celano · 14 lines
> > Similarly: > > proc:system("tesseract") returns [proc:error] Cannot run program "tesseract": error=2, No such file or directory > > Similarly: > > proc:system("tesseract", (), map {"dir" : "/usr/local/bin/"}) returns [proc:error] Cannot run program "tesseract" (in directory "/usr/local/bin"): error=2, No such file or directory > > The command "tesseract" works at the command line. I suspect there may be a problem with permissions: is there a way to overcome this error? Thanks. > > Best, > Giuseppe >
GC
Giuseppe G. A. Celano13 Nov 2019 18:21 #
Hi Christian, Interestingly, proc:execute("/usr/local/bin/tesseract") works (I have BaseX 9.2).
proc:system("/usr/local/bin/tesseract") returns the following:
Quoted text · Christian Grün · 1 line
> SET DEBUG true
DEBUG: true
Quoted text · Christian Grün · 1 line
> XQUERY proc:system("/usr/local/bin/tesseract")
org.basex.query.QueryException:
	at org.basex.query.func.proc.ProcSystem.item(ProcSystem.java:26)
	at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50)
	at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45)
	at org.basex.query.scope.MainModule.iter(MainModule.java:97)
	at org.basex.query.QueryContext.iter(QueryContext.java:332)
	at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90)
	at org.basex.core.cmd.AQuery.query(AQuery.java:107)
	at org.basex.core.cmd.XQuery.run(XQuery.java:22)
	at org.basex.core.Command.run(Command.java:257)
	at org.basex.core.Command.execute(Command.java:93)
	at org.basex.api.client.LocalSession.execute(LocalSession.java:132)
	at org.basex.api.client.Session.execute(Session.java:36)
	at org.basex.core.CLI.execute(CLI.java:92)
	at org.basex.core.CLI.execute(CLI.java:76)
	at org.basex.BaseX.console(BaseX.java:176)
	at org.basex.BaseX.<init>(BaseX.java:151)
	at org.basex.BaseX.main(BaseX.java:42)
org.basex.core.BaseXException: Stopped at ., 1/12:
[proc:code0001]
	at org.basex.core.Command.execute(Command.java:94)
	at org.basex.api.client.LocalSession.execute(LocalSession.java:132)
	at org.basex.api.client.Session.execute(Session.java:36)
	at org.basex.core.CLI.execute(CLI.java:92)
	at org.basex.core.CLI.execute(CLI.java:76)
	at org.basex.BaseX.console(BaseX.java:176)
	at org.basex.BaseX.<init>(BaseX.java:151)
	at org.basex.BaseX.main(BaseX.java:42)
Caused by: org.basex.query.QueryException:
	at org.basex.query.func.proc.ProcSystem.item(ProcSystem.java:26)
	at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50)
	at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45)
	at org.basex.query.scope.MainModule.iter(MainModule.java:97)
	at org.basex.query.QueryContext.iter(QueryContext.java:332)
	at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90)
	at org.basex.core.cmd.AQuery.query(AQuery.java:107)
	at org.basex.core.cmd.XQuery.run(XQuery.java:22)
	at org.basex.core.Command.run(Command.java:257)
	at org.basex.core.Command.execute(Command.java:93)
	... 7 more
Stopped at ., 1/12:
[proc:code0001]
Quoted text · Christian Grün · 40 lines
> On Nov 13, 2019, at 5:50 PM, Christian Grün <christian.gruen at gmail.com> wrote: > > Hi Giuseppe, > >> When I try to run >> proc:system("/usr/local/bin/tesseract") I get the error [proc:code0001] > > On my system, I get the (expected) error… > > [proc:error] Cannot run program "/usr/local/bin/tesseract": > CreateProcess error=2, Das System kann die angegebene Datei nicht finden > > …so we may need to find out what code 1 means in your case. Could you > run the query with debugging enabled and pass us on the stack trace? > > And your error code indicates that you are using an older version of > BaseX. Does it work with a more recent version? If not, what do you > get? > > Best, > Christian > > > > >> >> Similarly: >> >> proc:system("tesseract") returns [proc:error] Cannot run program "tesseract": error=2, No such file or directory >> >> Similarly: >> >> proc:system("tesseract", (), map {"dir" : "/usr/local/bin/"}) returns [proc:error] Cannot run program "tesseract" (in directory "/usr/local/bin"): error=2, No such file or directory >> >> The command "tesseract" works at the command line. I suspect there may be a problem with permissions: is there a way to overcome this error? Thanks. >> >> Best, >> Giuseppe >> >
CG
Christian Grün13 Nov 2019 18:48 #
Quoted text · Giuseppe G. A. Celano · 1 line
> Interestingly, proc:execute("/usr/local/bin/tesseract") works (I have BaseX 9.2).
How does the output look like?
Quoted text · Giuseppe G. A. Celano · 1 line
> proc:system("/usr/local/bin/tesseract") returns the following:
If the code 1 is raised, it indicates that your command will be executed indeed, but it returns the exit code 1. Which output would you expect?
Quoted text · Giuseppe G. A. Celano · 91 lines
> > SET DEBUG true > DEBUG: true > > XQUERY proc:system("/usr/local/bin/tesseract") > org.basex.query.QueryException: > at org.basex.query.func.proc.ProcSystem.item(ProcSystem.java:26) > at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50) > at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45) > at org.basex.query.scope.MainModule.iter(MainModule.java:97) > at org.basex.query.QueryContext.iter(QueryContext.java:332) > at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90) > at org.basex.core.cmd.AQuery.query(AQuery.java:107) > at org.basex.core.cmd.XQuery.run(XQuery.java:22) > at org.basex.core.Command.run(Command.java:257) > at org.basex.core.Command.execute(Command.java:93) > at org.basex.api.client.LocalSession.execute(LocalSession.java:132) > at org.basex.api.client.Session.execute(Session.java:36) > at org.basex.core.CLI.execute(CLI.java:92) > at org.basex.core.CLI.execute(CLI.java:76) > at org.basex.BaseX.console(BaseX.java:176) > at org.basex.BaseX.<init>(BaseX.java:151) > at org.basex.BaseX.main(BaseX.java:42) > org.basex.core.BaseXException: Stopped at ., 1/12: > [proc:code0001] > at org.basex.core.Command.execute(Command.java:94) > at org.basex.api.client.LocalSession.execute(LocalSession.java:132) > at org.basex.api.client.Session.execute(Session.java:36) > at org.basex.core.CLI.execute(CLI.java:92) > at org.basex.core.CLI.execute(CLI.java:76) > at org.basex.BaseX.console(BaseX.java:176) > at org.basex.BaseX.<init>(BaseX.java:151) > at org.basex.BaseX.main(BaseX.java:42) > Caused by: org.basex.query.QueryException: > at org.basex.query.func.proc.ProcSystem.item(ProcSystem.java:26) > at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50) > at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45) > at org.basex.query.scope.MainModule.iter(MainModule.java:97) > at org.basex.query.QueryContext.iter(QueryContext.java:332) > at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90) > at org.basex.core.cmd.AQuery.query(AQuery.java:107) > at org.basex.core.cmd.XQuery.run(XQuery.java:22) > at org.basex.core.Command.run(Command.java:257) > at org.basex.core.Command.execute(Command.java:93) > ... 7 more > Stopped at ., 1/12: > [proc:code0001] > > > > > On Nov 13, 2019, at 5:50 PM, Christian Grün <christian.gruen at gmail.com> wrote: > > Hi Giuseppe, > > When I try to run > proc:system("/usr/local/bin/tesseract") I get the error [proc:code0001] > > > On my system, I get the (expected) error… > > [proc:error] Cannot run program "/usr/local/bin/tesseract": > CreateProcess error=2, Das System kann die angegebene Datei nicht finden > > …so we may need to find out what code 1 means in your case. Could you > run the query with debugging enabled and pass us on the stack trace? > > And your error code indicates that you are using an older version of > BaseX. Does it work with a more recent version? If not, what do you > get? > > Best, > Christian > > > > > > Similarly: > > proc:system("tesseract") returns [proc:error] Cannot run program "tesseract": error=2, No such file or directory > > Similarly: > > proc:system("tesseract", (), map {"dir" : "/usr/local/bin/"}) returns [proc:error] Cannot run program "tesseract" (in directory "/usr/local/bin"): error=2, No such file or directory > > The command "tesseract" works at the command line. I suspect there may be a problem with permissions: is there a way to overcome this error? Thanks. > > Best, > Giuseppe > > >
GC
Giuseppe G. A. Celano13 Nov 2019 19:27 #
I would expect just some text, as with proc:system("ls") <result> <output>Usage: /usr/local/bin/tesseract --help | --help-extra | --version /usr/local/bin/tesseract --list-langs /usr/local/bin/tesseract imagename outputbase [options...] [configfile...] OCR options: -l LANG[+LANG] Specify language(s) used for OCR. NOTE: These options must occur before any configfile. Single options: --help Show this help message. --help-extra Show extra help for advanced users. --version Show version information. --list-langs List available languages for tesseract engine. </output> <code>1</code> </result> I guess that the "1" code blocks the printing. If I use proc:system("/usr/local/bin/tesseract", "--help"), it works. E-mail: celano at informatik.uni-leipzig.de <mailto:celano at informatik.uni-leipzig.de> Web site 1: http://asv.informatik.uni-leipzig.de/en/staff/Giuseppe_Celano <http://asv.informatik.uni-leipzig.de/en/staff/Giuseppe_Celano> Web site 2: https://sites.google.com/site/giuseppegacelano/ <https://sites.google.com/site/giuseppegacelano/>
Quoted text · Christian Grün · 108 lines
> On Nov 13, 2019, at 6:48 PM, Christian Grün <christian.gruen at gmail.com> wrote: > >> Interestingly, proc:execute("/usr/local/bin/tesseract") works (I have BaseX 9.2). > > How does the output look like? > >> proc:system("/usr/local/bin/tesseract") returns the following: > > If the code 1 is raised, it indicates that your command will be > executed indeed, but it returns the exit code 1. Which output would > you expect? > > > > > >>> SET DEBUG true >> DEBUG: true >>> XQUERY proc:system("/usr/local/bin/tesseract") >> org.basex.query.QueryException: >> at org.basex.query.func.proc.ProcSystem.item(ProcSystem.java:26) >> at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50) >> at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45) >> at org.basex.query.scope.MainModule.iter(MainModule.java:97) >> at org.basex.query.QueryContext.iter(QueryContext.java:332) >> at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90) >> at org.basex.core.cmd.AQuery.query(AQuery.java:107) >> at org.basex.core.cmd.XQuery.run(XQuery.java:22) >> at org.basex.core.Command.run(Command.java:257) >> at org.basex.core.Command.execute(Command.java:93) >> at org.basex.api.client.LocalSession.execute(LocalSession.java:132) >> at org.basex.api.client.Session.execute(Session.java:36) >> at org.basex.core.CLI.execute(CLI.java:92) >> at org.basex.core.CLI.execute(CLI.java:76) >> at org.basex.BaseX.console(BaseX.java:176) >> at org.basex.BaseX.<init>(BaseX.java:151) >> at org.basex.BaseX.main(BaseX.java:42) >> org.basex.core.BaseXException: Stopped at ., 1/12: >> [proc:code0001] >> at org.basex.core.Command.execute(Command.java:94) >> at org.basex.api.client.LocalSession.execute(LocalSession.java:132) >> at org.basex.api.client.Session.execute(Session.java:36) >> at org.basex.core.CLI.execute(CLI.java:92) >> at org.basex.core.CLI.execute(CLI.java:76) >> at org.basex.BaseX.console(BaseX.java:176) >> at org.basex.BaseX.<init>(BaseX.java:151) >> at org.basex.BaseX.main(BaseX.java:42) >> Caused by: org.basex.query.QueryException: >> at org.basex.query.func.proc.ProcSystem.item(ProcSystem.java:26) >> at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50) >> at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45) >> at org.basex.query.scope.MainModule.iter(MainModule.java:97) >> at org.basex.query.QueryContext.iter(QueryContext.java:332) >> at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90) >> at org.basex.core.cmd.AQuery.query(AQuery.java:107) >> at org.basex.core.cmd.XQuery.run(XQuery.java:22) >> at org.basex.core.Command.run(Command.java:257) >> at org.basex.core.Command.execute(Command.java:93) >> ... 7 more >> Stopped at ., 1/12: >> [proc:code0001] >> >> >> >> >> On Nov 13, 2019, at 5:50 PM, Christian Grün <christian.gruen at gmail.com> wrote: >> >> Hi Giuseppe, >> >> When I try to run >> proc:system("/usr/local/bin/tesseract") I get the error [proc:code0001] >> >> >> On my system, I get the (expected) error… >> >> [proc:error] Cannot run program "/usr/local/bin/tesseract": >> CreateProcess error=2, Das System kann die angegebene Datei nicht finden >> >> …so we may need to find out what code 1 means in your case. Could you >> run the query with debugging enabled and pass us on the stack trace? >> >> And your error code indicates that you are using an older version of >> BaseX. Does it work with a more recent version? If not, what do you >> get? >> >> Best, >> Christian >> >> >> >> >> >> Similarly: >> >> proc:system("tesseract") returns [proc:error] Cannot run program "tesseract": error=2, No such file or directory >> >> Similarly: >> >> proc:system("tesseract", (), map {"dir" : "/usr/local/bin/"}) returns [proc:error] Cannot run program "tesseract" (in directory "/usr/local/bin"): error=2, No such file or directory >> >> The command "tesseract" works at the command line. I suspect there may be a problem with permissions: is there a way to overcome this error? Thanks. >> >> Best, >> Giuseppe >> >> >> >
CG
Christian Grün13 Nov 2019 20:13 #
Good to see, everything’s alright then. proc:system will only output a result if the command was executed successfully. Giuseppe G. A. Celano <celano at informatik.uni-leipzig.de> schrieb am Mi., 13. Nov. 2019, 19:27:
Quoted text · Giuseppe G. A. Celano · 151 lines
> I would expect just some text, as with proc:system("ls") > > <result> > <output>Usage: > /usr/local/bin/tesseract --help | --help-extra | --version > /usr/local/bin/tesseract --list-langs > /usr/local/bin/tesseract imagename outputbase [options...] > [configfile...] > > OCR options: > -l LANG[+LANG] Specify language(s) used for OCR. > NOTE: These options must occur before any configfile. > > Single options: > --help Show this help message. > --help-extra Show extra help for advanced users. > --version Show version information. > --list-langs List available languages for tesseract engine. > </output> > <code>1</code> > </result> > > I guess that the "1" code blocks the printing. If I use > proc:system("/usr/local/bin/tesseract", "--help"), it works. > > E-mail: celano at informatik.uni-leipzig.de > Web site 1: http://asv.informatik.uni-leipzig.de/en/staff/Giuseppe_Celano > Web site 2: https://sites.google.com/site/giuseppegacelano/ > > On Nov 13, 2019, at 6:48 PM, Christian Grün <christian.gruen at gmail.com> > wrote: > > Interestingly, proc:execute("/usr/local/bin/tesseract") works (I have > BaseX 9.2). > > > How does the output look like? > > proc:system("/usr/local/bin/tesseract") returns the following: > > > If the code 1 is raised, it indicates that your command will be > executed indeed, but it returns the exit code 1. Which output would > you expect? > > > > > > SET DEBUG true > > DEBUG: true > > XQUERY proc:system("/usr/local/bin/tesseract") > > org.basex.query.QueryException: > at org.basex.query.func.proc.ProcSystem.item(ProcSystem.java:26) > at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50) > at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45) > at org.basex.query.scope.MainModule.iter(MainModule.java:97) > at org.basex.query.QueryContext.iter(QueryContext.java:332) > at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90) > at org.basex.core.cmd.AQuery.query(AQuery.java:107) > at org.basex.core.cmd.XQuery.run(XQuery.java:22) > at org.basex.core.Command.run(Command.java:257) > at org.basex.core.Command.execute(Command.java:93) > at org.basex.api.client.LocalSession.execute(LocalSession.java:132) > at org.basex.api.client.Session.execute(Session.java:36) > at org.basex.core.CLI.execute(CLI.java:92) > at org.basex.core.CLI.execute(CLI.java:76) > at org.basex.BaseX.console(BaseX.java:176) > at org.basex.BaseX.<init>(BaseX.java:151) > at org.basex.BaseX.main(BaseX.java:42) > org.basex.core.BaseXException: Stopped at ., 1/12: > [proc:code0001] > at org.basex.core.Command.execute(Command.java:94) > at org.basex.api.client.LocalSession.execute(LocalSession.java:132) > at org.basex.api.client.Session.execute(Session.java:36) > at org.basex.core.CLI.execute(CLI.java:92) > at org.basex.core.CLI.execute(CLI.java:76) > at org.basex.BaseX.console(BaseX.java:176) > at org.basex.BaseX.<init>(BaseX.java:151) > at org.basex.BaseX.main(BaseX.java:42) > Caused by: org.basex.query.QueryException: > at org.basex.query.func.proc.ProcSystem.item(ProcSystem.java:26) > at org.basex.query.expr.ParseExpr.value(ParseExpr.java:50) > at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:45) > at org.basex.query.scope.MainModule.iter(MainModule.java:97) > at org.basex.query.QueryContext.iter(QueryContext.java:332) > at org.basex.query.QueryProcessor.iter(QueryProcessor.java:90) > at org.basex.core.cmd.AQuery.query(AQuery.java:107) > at org.basex.core.cmd.XQuery.run(XQuery.java:22) > at org.basex.core.Command.run(Command.java:257) > at org.basex.core.Command.execute(Command.java:93) > ... 7 more > Stopped at ., 1/12: > [proc:code0001] > > > > > On Nov 13, 2019, at 5:50 PM, Christian Grün <christian.gruen at gmail.com> > wrote: > > Hi Giuseppe, > > When I try to run > proc:system("/usr/local/bin/tesseract") I get the error [proc:code0001] > > > On my system, I get the (expected) error… > > [proc:error] Cannot run program "/usr/local/bin/tesseract": > CreateProcess error=2, Das System kann die angegebene Datei nicht finden > > …so we may need to find out what code 1 means in your case. Could you > run the query with debugging enabled and pass us on the stack trace? > > And your error code indicates that you are using an older version of > BaseX. Does it work with a more recent version? If not, what do you > get? > > Best, > Christian > > > > > > Similarly: > > proc:system("tesseract") returns [proc:error] Cannot run program > "tesseract": error=2, No such file or directory > > Similarly: > > proc:system("tesseract", (), map {"dir" : "/usr/local/bin/"}) returns > [proc:error] Cannot run program "tesseract" (in directory > "/usr/local/bin"): error=2, No such file or directory > > The command "tesseract" works at the command line. I suspect there may be > a problem with permissions: is there a way to overcome this error? Thanks. > > Best, > Giuseppe > > > > > >

⚡Generated with XQuery