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

Hi Wayne,

PerlMonks is more of a place to learn Perl, and not usually a place where people do others' work for free - unless a monk happens to be interested, but that's not always the case, especially the more freebies one asks for ;-) If you're planning on fixing more bugs in the code, the best way to go would be to pick up at least a little bit of Perl yourself. perlintro is a good place to start, as well as Tutorials and learn.perl.org. Anyway, having said that...

Disclaimer: I don't know the rest of the "guiguts" code, so I don't know if the following will fix the issue 100% or if there will be any negative side effects on other parts of the code.

I'd try to hack the fix by adding the line chmod(0666&~umask,$filename) or warn "Couldn't chmod $filename"; after the line if ( rename( $tempfilename, $filename ) ) { (untested).

BTW, it'd be best to mention the existing bug report: https://sourceforge.net/p/guiguts/bugs/133/

Regards,
-- Hauke D

Replies are listed 'Best First'.
Re^8: File permissions problem (updated)
by wdhammond (Novice) on Dec 16, 2016 at 18:09 UTC

    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

      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