Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a function/method to read the mode of a file #4353

Closed
p6rt opened this issue Jun 26, 2015 · 7 comments
Closed

Add a function/method to read the mode of a file #4353

p6rt opened this issue Jun 26, 2015 · 7 comments
Labels
RFC Request For Comments

Comments

@p6rt
Copy link

p6rt commented Jun 26, 2015

Migrated from rt.perl.org#125489 (status was 'resolved')

Searchable as RT125489$

@p6rt
Copy link
Author

p6rt commented Jun 26, 2015

From anteusz@freemail.hu

Hi,

I cannot get the mode of a file in Perl 6.

In Perl5,
I can $input_file_permissions = ( stat $input_file )[2] & 0o7777;

Marton

@p6rt
Copy link
Author

p6rt commented May 21, 2016

From @smls

Agreed.

The .mkdir and .chmod methods on IO​::Path (as well as their subroutine forms &mkdir and &chmod), take a numeric $mode argument.

Therefore it only makes sense to also provide a way to fetch this mode number for an existing file.

We can already use the single-letter methods on IO​::Path to get *some* information about the permissions of an existing file from the point of view of the current user​:

  given "foo.txt".IO {
  say "readable" if .r;
  say "writable" if .w;
  say "executable if .x;
  }

But this does not cover the full information that the numeric file mode contains.

@p6rt
Copy link
Author

p6rt commented May 21, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 6, 2016

From @MasterDuke17

Implemented in rakudo/rakudo#773

@p6rt
Copy link
Author

p6rt commented Jul 28, 2016

From @MasterDuke17

Implemented in Rakudo PR #​773 (rakudo/rakudo#773).

@p6rt
Copy link
Author

p6rt commented May 29, 2017

From @MasterDuke17

Tests added in Raku/roast@9e76d49

@p6rt
Copy link
Author

p6rt commented May 29, 2017

@MasterDuke17 - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed May 29, 2017
@p6rt p6rt added the RFC Request For Comments label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request For Comments
Projects
None yet
Development

No branches or pull requests

1 participant