Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^8: File permissions problem (updated)

by wdhammond (Novice)
on Dec 16, 2016 at 18:09 UTC ( [id://1177937]=note: print w/replies, xml ) Need Help??


in reply to Re^7: File permissions problem (updated)
in thread File permissions problem

Thank you for all of your help Hauke.

The "bug report" was created by me but is not getting much attention so I am trying to correct my copy of the application to make my job easier. Mostly I have been formatting out of copyright books for Project Gutenberg. I am working on learning Perl too. Thanks too for the links.

Regards, Wayne
  • Comment on Re^8: File permissions problem (updated)

Replies are listed 'Best First'.
Re^9: File permissions problem
by haukex (Archbishop) on Dec 17, 2016 at 12:32 UTC

    Hi Wayne,

    The last commit on the Guiguts repository was a little over three years ago. If I were in your place, I might fork the repository, for example on GitHub, and start making my commits there (an excellent resource on learning Git is the Git Book). That way, changes would be public and other users could benefit from them, and if the developers are still active, they could pull selected changes back into their code.

    You don't need to know a ton of Perl for basic debugging tasks - a lot of my debugging needs are covered by Data::Dump, e.g. use Data::Dump 'pp'; and then at strategic places pp $variable;. What might also be helpful is use Carp 'cluck';, then cluck "test"; will give you stack traces. And as you begin to understand more and more Perl, that will help in posting better questions, such as locating the source of problems by boiling the code down to the minimum needed for others to be able to reproduce the problem.

    Of course we're happy to help, and if I made it sound too much like you already need to know Perl before asking questions here, that's not the case - you should have the willingness to learn Perl :-)

    Regards,
    -- Hauke D

      Thank you Hauke

      There is a lot of information in your response! I'm not sure I am qualified to fork the code though.

      From the documentation you supplied on File::Temp it would appear that 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. Am I on the right track with this logic?

      Regards, Wayne

        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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1177937]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-24 10:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found