Topic: New Extractor

Hi Borek,

I used to use the old extractor but seems that it's incompatible with the arbitrary numbering.
So I switched to the new extractor.
The problem that I'm facing is  it seems that it has a problem to open the input file.
here is the error:

IOError: [Errno 2] No such file or directory: 'OCTHole1000.oofem.out\r'

It seems that it thinks the return character is included in the file name and because of that it cannot locate the file.

I would appreciate it if you could help me with this.
Alireza

Re: New Extractor

in the line #595 of extractor.py, I changed "infile = open(oofemoutfilename[:-1])" to "infile = open(oofemoutfilename[:-2])" and it worked

3

Re: New Extractor

Dear Alireza,

this is because of the newline character is different on Unix/Linux and Win systems (where represented by two characters). The change you have made is a kind of quick hack, which will not work with Unix files.
The portable solution would be:

infile = open(oofemoutfilename.rstrip("/r/n"))

Borek

Re: New Extractor

Dear Borek,

Thanks for the reply. I'll change the code to this one.
Btw. I'm using Linux (86_64) not Windows.

Cheers
Alireza

Re: New Extractor

I'm observing another minor problem in this new extractor.
Some times it seems that the program cannot see the end of file and it just keeps running forever.

6

Re: New Extractor

Dear Alireza,

if you have such an example, that breaks extractor, I would be interested to get it so I can fix the problem.
Borek

Re: New Extractor

Sure, I'll send it to you as soon as I experience it again.

Alireza