fails to open GDS on Mac, but OK on Windows

I'm writing a script to manipulate GDS, and found that it fails to open GDS on Mac, while ok on Windows.
The script to read GDS is:
# Read and create a layout
lo = LoadLayoutOptions::new
lo.layer_map.assign(lm)
ly = Layout::new
crt_ly = CellView::active
file_name = crt_ly.name
ly.read(crt_ly.name, lo)

Error message on Mac is:
"Unable to open file: filename.gds (errno=2) in Layout::read"
It is confirmed that "file_name" is actually the file name (without path) of active GDS.

Any idea to solve this problem? Thanks.

Comments

  • @akita11 The paths are resolved relative to the current directory and this is the one you start KLayout from. I assume that MacOS uses a different place than Windows.

    You should take the file path from "crt_ly.filename" which gives you the full path.

    Matthias

  • Thanks, actually, it works by using the attribute of "filename" instead of "name", like:
    y.read(crt_ly.filename, lo)

Sign In or Register to comment.