in reply to Re^10: File permissions problem
in thread File permissions problem

Hi Wayne,

every instance of the file would be read only and the "readonly" test should not be needed, the file permissions should be changed on save

As far as I can tell files created by File::Temp should normally be 0600 (read+write for the owner and no access to anyone else). By "readonly test" I assume you're referring to the function fileisreadonly in the OP (source). The way I understand that code is that the check is applied before the file is saved, so that in case the user is trying to write to a file that is readonly, the user is first asked if they want to overwrite the file anyway.

It would make sense to me that a file is left with read+write permissions for the owner after the save - at least I've never seen someone set their umask so that the owner's permissions are restricted. The idea behind the code I suggested is that the file permissions should be determined by the user's umask, so that the user can choose whether they want the files to be 0666, 0644, 0664, 0640, or whatever other combination they like, instead of the files always ending up 0600.

Hope this helps,
-- Hauke D