From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Leo Prikler Newsgroups: gmane.lisp.guile.bugs Subject: bug#44186: Recursive mkdir Date: Tue, 27 Oct 2020 10:19:50 +0100 Message-ID: References: <064c08f86112e49533000738aa01f98314d3b08b.camel@divoplade.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23795"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.34.2 Cc: 44186@debbugs.gnu.org To: divoplade Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Tue Oct 27 10:20:08 2020 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXL9D-00064v-WC for guile-bugs@m.gmane-mx.org; Tue, 27 Oct 2020 10:20:08 +0100 Original-Received: from localhost ([::1]:49266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXL9D-0005dF-1G for guile-bugs@m.gmane-mx.org; Tue, 27 Oct 2020 05:20:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXL99-0005d7-1D for bug-guile@gnu.org; Tue, 27 Oct 2020 05:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXL98-0003KZ-Mq for bug-guile@gnu.org; Tue, 27 Oct 2020 05:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kXL98-0006ET-Iu for bug-guile@gnu.org; Tue, 27 Oct 2020 05:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 27 Oct 2020 09:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44186 X-GNU-PR-Package: guile Original-Received: via spool by 44186-submit@debbugs.gnu.org id=B44186.160379039723942 (code B ref 44186); Tue, 27 Oct 2020 09:20:02 +0000 Original-Received: (at 44186) by debbugs.gnu.org; 27 Oct 2020 09:19:57 +0000 Original-Received: from localhost ([127.0.0.1]:42889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXL93-0006E6-3I for submit@debbugs.gnu.org; Tue, 27 Oct 2020 05:19:57 -0400 Original-Received: from mailrelay.tugraz.at ([129.27.2.202]:13111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kXL91-0006Dx-3I for 44186@debbugs.gnu.org; Tue, 27 Oct 2020 05:19:56 -0400 Original-Received: from nijino.local (217-149-162-161.nat.highway.telekom.at [217.149.162.161]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4CL5kv4qwNz3wWP; Tue, 27 Oct 2020 10:19:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1603790391; bh=5GzEpsIFeK6t+Vdj/2VsRqBbV6XdmdxB8QvfwP0XpyY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=iZcyCrdEeYnutKbHq18MntKwBgNeYd4f4O7Dm1t2aikLwj9mZlGDw1Cf46gl1EhHu BPa+ssLoiAGwJ9E1n6M8vJzExf4KFFsuNmV75dGvcuM8V8R22zrLniGAgfm2txsMGx t5itT3HknTWBt7+9AKS1tXIK2qZ4HnuALk0tU3N8= In-Reply-To: <064c08f86112e49533000738aa01f98314d3b08b.camel@divoplade.fr> X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:9914 Archived-At: Hello, Am Dienstag, den 27.10.2020, 08:01 +0100 schrieb divoplade: > I think I have made my point for the second commit. I intend this > change to be user-centric: it would be better to confuse the > developer > of a guile program than the user of said program. Anyway, this will > not > confuse anyone because creating the directory is not the default > behavior. I am very not pleased with this distinction of "user" and "developer". Even assuming there is some, it would be wiser not to confuse the latter, as then they can assure on their own terms, that the former won't be confused either. When you've reached the point, where "even" the latter can't tell you what exactly will happen, how exactly are you going to ensure the former won't be confused in the event something *does* go wrong? Spoiler warning: Returning #t on error won't actually fix them. > As for the first commit: > > Le lundi 26 octobre 2020 à 22:05 +0100, Leo Prikler a écrit : > > I'd prefer it if you didn't credit me for messing up your code. ;) > > The reason my version works, is because (ice-9 filesystem) has a > > working implementation of file-ancestors, which it uses to create > > all > > ancestors in order. The part you've copied only creates one such > > directory. With the changes you've made, the directory, that does > > get > > created, is the first one in the tree, which does not exist. I'm > > surprised, that this test passes for you, because it does not pass > > for > > me. > > Exactly, it does not pass the test, because I still can't run them. That's one way to see it. For the record, I didn't actually run your test, but instead copied your code as well as a test into a separate file rather than building all of guile. That's an easier way of prototyping. > In which file do I write the code, I feel the ports module is not the > best place. That's because it isn't. The only reason you could be led to putting it there is because of your insistence on the second patch (recall, that it is not at all needed) along with possibly a belief, that the only reason to recursively make a directory is to put files at their root, which is also wrong. As I have been suggesting multiple times already, you could potentially maybe drop your second patch without making much impact on those developers and users, who receive an error when opening a file port without ensuring the parent directory to exist. That would allow you to put mkdir-recursive into the posix module (and test it along with it) even if it isn't strictly POSIX. If that's not your cup of tea and you have more than just mkdir-recursive to add, you might want to put it into a different module. Please also note, that Guile also doesn't particularly need *your* implementation of mkdir-p (or mine for that matter). Ludovic Courtès, who you might remember being a co-maintainer along with Andy Wingo, wrote mkdir-p for GNU Guix, so whether or not it gets included here is much rather a question of whether or not they want to relicense it under the LGPL. > How do you run the tests? When I run "make check", I get 1 of 39 > tests failed, the test-out-of-memory test. It does not even try to > run the ports test. Have a look at test-suite/Makefile.am. Regards, Leo