Output result to specified file path
![](https://secure.gravatar.com/avatar/7300d3eb9b50cf7e8728cb7991d01275.jpg?s=120&d=mm&r=g)
How do you set the target output path and file name? Consider: % SOF \starttext Hello \stoptext % EOF Save as $HOME/test.tex and then: mkdir /tmp/subdir context --result=/tmp/subdir/test.pdf $HOME/test.tex Expected: PDF file is created in /tmp/subdir directory. Actual: PDF file is created in $HOME directory. Version: 2021.03.27 19:09 Thank you!
![](https://secure.gravatar.com/avatar/e5aa6984b53b8925e405ebbdbc051ad9.jpg?s=120&d=mm&r=g)
Am 30.03.2021 um 07:05 schrieb Thangalin
: How do you set the target output path and file name? Consider: context --result=/tmp/subdir/test.pdf $HOME/test.tex
Expected: PDF file is created in /tmp/subdir directory.
Actual: PDF file is created in $HOME directory.
That’s known behavior. ConTeXt will never write to other directories than the current. Sorry. Doesn’t fit my needs, too. Hraban
![](https://secure.gravatar.com/avatar/46562c7d27388490d62e8d7a5bc960dd.jpg?s=120&d=mm&r=g)
On 3/30/2021 9:13 AM, Henning Hraban Ramm wrote:
Am 30.03.2021 um 07:05 schrieb Thangalin
: How do you set the target output path and file name? Consider: context --result=/tmp/subdir/test.pdf $HOME/test.tex
Expected: PDF file is created in /tmp/subdir directory.
Actual: PDF file is created in $HOME directory.
That’s known behavior. ConTeXt will never write to other directories than the current.
Sorry. Doesn’t fit my needs, too.
just do the reverse: go to the wanted path and run from there (and use --path for picking up stuff) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/7300d3eb9b50cf7e8728cb7991d01275.jpg?s=120&d=mm&r=g)
context --jit prd_${PRD} --result=_pdf/$RESULT --mode=$MOD Does this mean the example is incorrect? Or did it once work and the behaviour has since changed? Or is it that relative directories are fine but absolute paths won't work? Let me know and I'll update the wiki with the correct behaviour.
![](https://secure.gravatar.com/avatar/413d18d786a923120159c1e3f02ad778.jpg?s=120&d=mm&r=g)
IIRC, there’s currently no support for this.
--result= can be used to rename the output file, but it can not be used to create the file in a specific directory, nor to move it there.
Such a feature would be quite useful though, I think.
Maybe two options?
--result=foo.pdf => rename output to foo.pdf
--output-dir=/somedir => create output file in /somedir (but keep the regular file name)
--result=/somedir/foo.pdf => create foo.pdf at a specific location.
Denis
Von: ntg-context
participants (4)
-
denis.maier@ub.unibe.ch
-
Hans Hagen
-
Henning Hraban Ramm
-
Thangalin