Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

To iterate is human, to recurse, divine. -- Robert Heller


devel / comp.lang.tcl / Re: Java in Tcl

SubjectAuthor
o Java in Tclsnosniv

1
Re: Java in Tcl

<22ba13b1-2385-4f18-9482-4a528135ca5en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=9873&group=comp.lang.tcl#9873

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a37:4cd:0:b0:6ec:5396:3abe with SMTP id 196-20020a3704cd000000b006ec53963abemr22473114qke.293.1666618712963;
Mon, 24 Oct 2022 06:38:32 -0700 (PDT)
X-Received: by 2002:a05:620a:95b:b0:6ec:90d2:5fe7 with SMTP id
w27-20020a05620a095b00b006ec90d25fe7mr22740667qkw.425.1666618712774; Mon, 24
Oct 2022 06:38:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Mon, 24 Oct 2022 06:38:32 -0700 (PDT)
In-Reply-To: <6aa4371f-4408-4c4f-800a-b9ab41b3f42en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.1.128.13; posting-account=gstOigoAAADV9pmzZL58qQ436SKV3SBu
NNTP-Posting-Host: 82.1.128.13
References: <b7d9f18b-5855-48b4-b0be-f5810fe741dfn@googlegroups.com> <6aa4371f-4408-4c4f-800a-b9ab41b3f42en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <22ba13b1-2385-4f18-9482-4a528135ca5en@googlegroups.com>
Subject: Re: Java in Tcl
From: nivpars...@gmail.com (snosniv)
Injection-Date: Mon, 24 Oct 2022 13:38:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3346
 by: snosniv - Mon, 24 Oct 2022 13:38 UTC

On Saturday, 12 February 2022 at 22:50:10 UTC, briang wrote:
> On Friday, February 11, 2022 at 10:35:00 AM UTC-8, snosniv wrote:
> > I have a simple batch file which invokes Java to run a conversion algorithm, this works just fine, but I can't seem to get it work within Tcl.
> >
> > batch file is:
> >
> > cd c:/Users/Downloads/Fit_files
> > java -jar C:\Users\Downloads\__Installation_files\FitSDKRelease_21.67.00\java\FitCSVTool.jar -b C:\Users\Downloads\Fit_files\FIT2CSV\INFILE.fit C:\Users\Downloads\Fit_files\FIT2CSV\OUTFILE.csv
> >
> > But I can't seem to invoke Java from within Tcl?
> > What do I need to do please?
> You have to take care with file path names in Tcl. The syntax for a pathname is different from a cmd shell. The backslash character (\) is used as an escape character, so in Tcl, to use it in a path name, the character must be escaped:
>
> java -jar c:\\Users\\Downloads\\__Installation_files\\FitSDKRelease_21.67.00\\java\\FitCSVTool.jar -b C:\\Users\\Downloads\\Fit_files\\FIT2CSV\\INFILE.fit C:\\Users\\Downloads\\Fit_files\FIT2CSV\OUTFILE.csv
>
> Or you can essentially escape the entire path using braces ({}):
> java -jar {C:\Users\Downloads\__Installation_files\FitSDKRelease_21.67.00\java\FitCSVTool.jar} -b {C:\Users\Downloads\Fit_files\FIT2CSV\INFILE.fit} {C:\Users\Downloads\Fit_files\FIT2CSV\OUTFILE.csv}
> Or you can use forward slashes (/):
> java -jar C:/Users/Downloads/__Installation_files/FitSDKRelease_21.67.00/java/FitCSVTool.jar -b C:/Users/Downloads/Fit_files/FIT2CSV/INFILE.fit C:/Users/Downloads/Fit_files/FIT2CSV/OUTFILE.csv
>
> Of course in order to run any external program, the [exec] command should be used:
>
> exec java -jar ...
>
> To capture any return values, use the [set] command:
>
> set return_value [exec java -jar ...]
>
> Also, you can verify that Tcl can find the program using the [autoexec_ok] command:
> if {[autoexec_ok java] ne ""} {
> set return_value [exec java -jar ...]
> }
>
> -Brian
Ah, hadn't thought about the escape, Doh. Thanks for the tip (I haven't dabbled in Tcl for a few years since I retired, but have something at home I want to do).

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor