Fwrite(): arg not valid stream resource -- but works

[Problem solved]

Short Answer: goofball coder. Long answer: method writes two files, called by two other methods, was looking at the wrong caller.At least it keeps me off the streets.