Search code examples
specmane

Specman e error: No match for file when using "for each line in file"


I have a my_text.txt file and the next e file in the same directory:

extend my_unit {

    run() is also {
        for each line in file "my_text.txt" do {
            // ...
        };
    };
};

I get the next run error:

*** Error: No match for file 'my_text.txt'

Why do I get the error? How the for loop over all lines in a text file should be used?

Thank you for your help


Solution

  • The file name is looked for relatively to your working directory (from which you run Specman), not relatively to the source file in which the code is written. It does consider SPECMAN_PATH, but probably your SPECMAN_PATH does not point directly to that directory.