Daniel Dan - 2013-11-05

#outdir and #outfile commands

In VCL 1.1 we add two new commands for setting up the output file and directory.

% #outdir <expression> specifies the output directory
#outdir "aaa/bbb" 
% output directory will be "aaa/bbb" a file will be created with the name of the
% current output file, and further output goes in the new file.
% #outfile <expression> specifies the output file
#outdir "output.txt" 
% output directory will be the same as before, the processor creates 
% (or opens) the file output.txt and further output goes in the new file.

Relative path in VCL 1.1

In VCL 1.1 relative paths in #adapt and #output, #outdir, #outfile commands will be progressed in the following way:

#adapt: The relative path starts form the last adapted file (currently processed file). Therefore, when the processor executes an #adapt command, the relative file addressing changes accordingly.
#output: The relative path starts from the directory of the last given #output or #outdir command
The default adapt and output relative path starts from the VCL processor's input file.

Example:

Folders and files

c:/vclTest/AAA                    c:/vclTest/output
     |                                   |
     |----SPC.vcl                        |-----newOutfolder
     |----BBB                            |      |
     |     |                             |      |-----out1.txt
     |     |-----CCC                     |      |-----out2.txt
     |     |      |-----file1.vcl        |
     |     |                             |-----out1.txt
     |     |-----file2.vcl
     |     |-----file3.vcl
     |
     |----DDD
     |     |-----file4.vcl

starting file: "c:\vclTest\AAA\SPC.vcl"

SPC.vcl

#output "../output/out1.txt"
% output dir is  :    c:/vclTest/output/
% output file is :    c:/vclTest/output/out1.txt
#adapt "BBB/CCC/file1.vcl" 
% path of the adapted file is: c:/vclTest/AAA/BBB/CCC/file1.vcl

file1.vcl

#outdir "newOutfolder"
% output dir is  :    c:/vclTest/output/newOutfolder
% output file is :    c:/vclTest/output/newOutfolder/out1.txt
#adapt "../file2.vcl" 
% path of the adapted file is: c:/vclTest/AAA/BBB/file2.vcl

file2.vcl

#outfile "out2.txt"
% output dir is  :    c:/vclTest/output/newOutfolder
% output file is :    c:/vclTest/output/newOutfolder/out2.txt
#adapt "file3.vcl" 
% path of the adapted file is: c:/vclTest/AAA/BBB/file3.vcl

file3.vcl

#adapt "c:/vclTest/AAA/file4.vcl" % it can be absolute path too
% path of the adapted file is: c:/vclTest/AAA/file4.vcl
 

Last edit: Daniel Dan 2013-11-05