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
Can we relax indir's test on the target directory? #5953
Comments
From @briandfoyindir is in S16 but not documented elsewhere, but it's a really cool indir '/Users/brian', { indir '/etc', { The second one fails with Failed to change the working directory to '/etc': did not pass 'd r w' test I don't know why it insists that the directory be writable, expecially And, since its undocumented, nobody else knows that it does this currently. :) |
From @cognominalNot only .indir default is strange, but the behavior of .chdir it relies :test<rw> # read/writeable by user Or is this overengineering ? The current code in .chdir looks like a placeholder for something to come. if $test eq 'r' { On Fri, Dec 30, 2016 at 11:06 PM, brian d foy <perl6-bugs-followup@perl.org>
-- |
The RT System itself - Status changed from 'new' to 'open' |
From @zoffixznetOn Fri, 30 Dec 2016 14:06:51 -0800, comdog wrote:
That's because there's not a single mention of it in the 6.c Perl 6 Language Specification[^1] and we don't document unspecced things. Personally, I rather leave it that way for now, until we get a chance to revamp our IO API (which very likely won't be possible until 6.d language release). Passing those strings for $test is pretty inflexible and bug prone and I rather see us toss that sort of API from chdir; and the fewer things rely on its current behaviour the better. |
From @lizmatFWIW, I think this is a leftover / half baked thing from the newio branch.
|
From @briandfoy
That's contrary to my experience. For instance, https://rt-archive.perl.org/perl6/Ticket/Display.html?id=130419 , along with many other things I've found. Since the spec is basically a test in roast, that's an easy technical fix. But, you said "your PR testing or documenting it will be rejected" (https://www.learningperl6.com/2016/12/30/indir-changes-the-directory-just-for-its-block/#comment-348). If patches aren't welcome, then there's a different issue to address: Is there a roadmap or other notes that pull together the direction for future work, what's in or out, what's off limits, and such. |
From @toolforgerAm 30.12.2016 um 23:06 schrieb brian d foy (via RT):
If you go by Posix logic, indir and chdir need just searchability (the x Readability (r) is for getting a list of all files. Unless there is a reason for requiring readability for chdir or indir, I The usual reason would be portability, but at least Windows follows the |
From @geekosaurOn Fri, Dec 30, 2016 at 5:41 PM, Joachim Durchholz <jo@durchholz.org> wrote:
But all bets are off if it's a network filesystem. -- |
From @briandfoyI would expect indir to call chdir and let the exceptions fall where To me, the spirit of Perl has been "if that's what you want to do, |
From @toolforgerAm 02.01.2017 um 22:28 schrieb brian d foy:
Um, well, if it were possible to really build a nicer interface on top |
From @zoffixznetOn Sun, 01 Jan 2017 10:48:07 -0800, comdog wrote:
That's because many things were documented prior to our installment of that policy and have been simply missed.
Well, it's true, it's very easy to lock us into supporting the current API and behaviour I see support from users for having the `indir` routine, so I doubt any change would involve removing it from
Nothing I have in writing yet, as I set off on this quest to improve IO when I went to fix your `chdir` 1) We'll still have `indir` (so adding spectests today just for basic functionality, like we have for `chdir` is OK, I think) As for roadmap, first I plan to make a "map" of all of our core routines to find out what calling convention is most common and what's the typical way to indicate failure. That will guide the decision for the calling form and failure mode for the `indir` and related IO routines. In the past year, any time something awful about IO was brought up, the `newio` branch was mentioned as being one where the awfulness was fixed. It's a branch that was made prior to first Christmas release, but never got merged. So the next step on the roadmap would be to examine the changes[^2] that branch would've made were it merged before Christmas release and see what we can/want to have in current code, to improve our IO. Not every change will be possible, because we can't break existing spectests, and that's precisely the reason why spectests for current API of indir should not be added. [1] https://webchat.freenode.net/?channels=#perl6 Cheers, |
From @toolforgerAm 03.01.2017 um 01:48 schrieb Zoffix Znet via RT:
Yes, chdir is nasty because it's a global setting and you never know indir solves all these things. (Provided it changes the current
Some platform might even be okay with a nondirectory for chdir. This That said, I think the indir tests should just test that chdir is being
Oh, is Perl6 that stable now?
+1 |
From @lizmat
Please note that there is no real chdir() at the OS level, because that is a bad idea in a threaded environment. And for that reason, the JVM doesn’t allow for it, afaik, and thus it wouldn’t work on the JVM backend anyway. The “current directory” is represented by the
Since changing the current directory is nothing else than changing $*CWD, mocking should not be a problem.
I hear they’re still fixing mistakes in Perl 5. Which, in my impression, is considered stable by many :-) Liz |
From @geekosaurOn Tue, Jan 3, 2017 at 12:58 AM, Joachim Durchholz <jo@durchholz.org> wrote:
Edge case: current directory can't be re-entered by path (as with the old -- |
From @toolforgerAm 03.01.2017 um 09:59 schrieb Elizabeth Mattijsen:
That would be the JDK, not the JVM (which does not implement these things).
Ah, I didn't know what.
+1
:-D |
From aar@cpan.orgOn Tue, 03 Jan 2017 01:00:52 -0800, elizabeth wrote:
In fact, I don't see why would indir perform additional checks and/or have any different behavior than: temp $*CWD = chdir($dir); or even: temp $*CWD = $dir; (Do we actually need that much syntactic sugar in the core, for things that are clear enough and not that verbose? The "foo $tempvalue, BLOCK" pattern could be an alternative for "temp" in so many cases... are we going to cover them all?) |
From @zoffixznetOn Fri, 30 Dec 2016 14:06:51 -0800, comdog wrote:
Thank you for the report. This ticket is now resolved. `indir` is now part of the Perl 6 language. Please consult with the documentation for its behaviour: |
@zoffixznet - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#130460 (status was 'resolved')
Searchable as RT130460$
The text was updated successfully, but these errors were encountered: