dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.28k stars 1.58k forks source link

add modeOctalString to FileStat for compatibility with Posix tools #57086

Closed stephane-archer closed 6 days ago

stephane-archer commented 1 week ago

add modeOctalString to FileStat for compatibility with Posix tools

google-cla[bot] commented 1 week ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

copybara-service[bot] commented 1 week ago

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/395260

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

mraleph commented 6 days ago

Thanks for the PR but this is just an equivalent to stat.mode.toRadixString(8). I don't think there is any need to add it as a separate method. Also it is a breaking change for anything implementing the FileStat class.

stephane-archer commented 6 days ago

I was not aware of "stat.mode.toRadixString(8)" is it exactly equivalent?

mraleph commented 6 days ago

I guess you might also need to mask things if you don't care about top bits: (stat.mode & 0x1FF).toRadixString(8)