Parameter provided by -rd flag is not read properly. What is wrong?

Hi all,

We have a strange problem while passing a parameter to Ruby script by -rd flag.
May be the problem occurs for specific klayout version/operating system, since on other machines the problem does not appear.

Where's a very simple script:
puts "Something"
input_file = $input.split.collect
input_file= input_file.to_s

Those print use only for checking, soulde remove

puts "input_file= #{input_file}"
ly = RBA::Layout.new
ly.read(input_file)

and we are running it by :
/usr/bin/klayout -rd input=Hephaestus_1412.gds -r /home/lnstaff/cadadm/RepCheck/test.rb

I was expecting the script to write the name of the gds file and open it.
But the output I receive is as follows:
Output:
Something
input_file= #
*** ERROR: /home/lnstaff/cadadm/RepCheck/test.rb:12: Unable to open file: # (errno=2) in Layout::read
/home/lnstaff/cadadm/RepCheck/test.rb:12:in read' /home/lnstaff/cadadm/RepCheck/test.rb:12:in

' (class RuntimeError)

So definitely input variable is not received correctly.

Thank you very much for your help.

Yulia

Comments

  • Hi Yulia,

    why do you use "split.collect"? The latter will deliver an enumerator which makes the string saying "#<Enumerator...>".

    Just use "$input" for the input file name. That's it.

    Matthias

Sign In or Register to comment.