Same OS, same code, no problem. I would almost think the file you are writing to is write protected, but I suppose you checked that?