Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: [Cygwin] Setting and getting file permissions as octal numbers

by syphilis (Archbishop)
on Sep 04, 2022 at 03:45 UTC ( [id://11146669]=note: print w/replies, xml ) Need Help??


in reply to Re: [Cygwin] Setting and getting file permissions as octal numbers
in thread [Cygwin] Setting and getting file permissions as octal numbers

I do find that execute permissions are automatically set for new files from a non-cygwin source copied to somewhere under /cygdrive/

That's the type of problem I'm trying to avoid - the programmatic alterations are being made on a copy of the original file and then moved back.
Prior to reading your post, I had not realized that it was the move rather than the "programmatic alterations" that was the source of the trouble.

I'm finding that even copying a file (using the Windows clipboard) from /home/me/someplace to /home/me/elsewhere will set the execution bits on the copy.
It's probably a case of just avoiding moving the file, by editing the file in place. (That seems to work ok, but I'll still be setting the perms to their original value anyway.)

A rarer case is that I have also had execution bits mysteriously vanish. I haven't really found out how that happens, so I'll be guarding against that, too.

Should I also be paying attention to the perms settings of the files that make up my perl module source distros on CPAN ?
Those files inside the source tarballs all originate from a Cygwin environment, and the ones that I have just checked have their execution bits set.
Should I be concerned about that ? (No-one has ever complained about the perms settings of the files in my perl modules.)

Cheers,
Rob
  • Comment on Re^2: [Cygwin] Setting and getting file permissions as octal numbers

Replies are listed 'Best First'.
Re^3: [Cygwin] Setting and getting file permissions as octal numbers
by kcott (Archbishop) on Sep 04, 2022 at 08:42 UTC

    Firstly, see the update to my post. Hopefully, the originally incorrect /cygdrive/ (now changed to /cygdrive/c/cygwin64) didn't mislead you; my apologies if it did.

    It seems our mode of operating differs somewhat; for instance, I don't believe I've ever used Windows clipboard to copy a file. I rarely use File Explorer for anything; ironically, the most common use is to update Cygwin (for the current 3.3.5 version: C:\Users\ken\local\opt\cygwin\3_3_5\setup-x86_64.exe). I use a Cygwin CLI to create files: "cp old new", "vim new" and "> new" would be the most common for individual files; "module-starter --module=New::Module" creates a directory structure for a new module — none of these creates files with inappropriate permissions.

    I checked through all of my (Perl v5.36) @INC directories. The core modules were installed using perlbrew; all CPAN modules were installed using the cpan utility (two exceptions; "cpan: Terminal does not support AddHistory." has details); all personal modules were installed with a standard "make install". All *.pm files had 444 permissions (except for one black sheep, Tcl.pm, which had 555 — I've no idea what happened there).

    I found an old Strawberry Perl v5.26.3 installation; I don't recall details of setting this up. All *.pm files in lib and vendor/lib had 444 permissions with owner ken; all in site/lib had 555 with owner Administrators.

    That's about all the info I could think of that was relevant. I'm happy to share more if you think it will be useful; just ask. Bear in mind how our different ways of working may affect outcomes.

    "No-one has ever complained about the perms settings of the files in my perl modules."

    I'm really no expert in this area; take the following as (potentially ill-informed) opinion. If no one has ever complained, there's probably no urgency to "fix" what's not broken. I see you have "25 distributions uploaded to CPAN". Perhaps change the permissions in one distro as a test; look at working on the others as updates are made.

    — Ken

      Perhaps change the permissions in one distro as a test;look at working on the others as updates are made

      Yes - I think that's the approach to take.
      Thanks for the feedback.

      Cheers,
      Rob

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found