On Wed, 1 Nov 2006, Jevgeni Astanovski wrote:
Can anyone give me an advise, why _Rclose can fail?
In main(), you open FileName. The file handle is in fpr. You pass fpr to CallIterate, which closes the file associated with fpr. Inside CallIterate, you open FileName again, assigning it to the *local* variable fpr (local to CallIterate). On the second CallIterate call, CallIterate tries to close the *original* fpr, the one local to main, which is already closed.