You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change directory.open_file() to use readonly open (ponylang#2697)
* Change directory.open_file() to use readonly open
On non-Linux and non-BSD platforms the direction.open_file() logic
defaults to a named path base open, rather than using `openat` calls.
However, this was using the `File.create(...)` call which opens files
for read/write, rather than just readonly. This in turn fails since
the `FileWrite` capability is explicitly dropped.
This commit simply switches to using `File.open(...)` which opens the
file in a readonly mode.
This fixes: ponylang#2695
* Introduce a unit test Directory.open_file
Note, care needs to be taken not the mask the `error` in a:
```
try
...
then
...
end
```
that does not have an `else` block.
* Tweak to match stdlib style guide.
Space between : and type.
0 commit comments