From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Michalis V." Newsgroups: gmane.emacs.bugs Subject: bug#47058: 28.0.50; Dired Z: insert-directory: Reading directory: No such file or directory, CrossLine_linux_x86 Date: Tue, 21 Sep 2021 23:11:22 +0300 Message-ID: <87o88ly9hx.fsf@gmail.com> References: <86o8fqdab2.fsf@protected.rcdrun.com> <8735qpz4dh.fsf@fing.edu.uy> <875yuuq4lh.fsf@gmail.com> <87k0jaft05.fsf@gnus.org> <83wnnaz67v.fsf@gnu.org> <87a6k6qoat.fsf@cnu407c2zx.nsn-intra.net> <83fstyz334.fsf@gnu.org> <87lf3pzwge.fsf@gnus.org> <052fb8a67e3d62982081@heytings.org> <834kadydjo.fsf@gnu.org> <052fb8a67e886712c3e6@heytings.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38284"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: mvar.40k@gmail.com, 47058@debbugs.gnu.org, mcenturion@fing.edu.uy, arthur.miller@live.com, larsi@gnus.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 21 22:12:25 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mSm7t-0009hF-5X for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Sep 2021 22:12:25 +0200 Original-Received: from localhost ([::1]:40052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSm7r-0001Qy-V6 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Sep 2021 16:12:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSm7W-0001Lt-C7 for bug-gnu-emacs@gnu.org; Tue, 21 Sep 2021 16:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSm7W-0003iT-4H for bug-gnu-emacs@gnu.org; Tue, 21 Sep 2021 16:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mSm7V-00080M-JM for bug-gnu-emacs@gnu.org; Tue, 21 Sep 2021 16:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Michalis V." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Sep 2021 20:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47058 X-GNU-PR-Package: emacs Original-Received: via spool by 47058-submit@debbugs.gnu.org id=B47058.163225509530732 (code B ref 47058); Tue, 21 Sep 2021 20:12:01 +0000 Original-Received: (at 47058) by debbugs.gnu.org; 21 Sep 2021 20:11:35 +0000 Original-Received: from localhost ([127.0.0.1]:48108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSm72-0007zZ-Gs for submit@debbugs.gnu.org; Tue, 21 Sep 2021 16:11:35 -0400 Original-Received: from mail-ed1-f42.google.com ([209.85.208.42]:37850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSm70-0007zK-MN for 47058@debbugs.gnu.org; Tue, 21 Sep 2021 16:11:31 -0400 Original-Received: by mail-ed1-f42.google.com with SMTP id bx4so997228edb.4 for <47058@debbugs.gnu.org>; Tue, 21 Sep 2021 13:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Uh9GkB7Ep9TymwPbnm2p7s9g/wKlBS76q/egVLBssNg=; b=SA1rULCYAfqqneo30/gnn4yIt2qarypylSphgvRxekjyouJ8Tv6ntBkU8SOrmiCa0h LEOTeeBREIrVRxZNxJq8XNG31lWHQzTM9bpyN4EqG7+JgFNlXoi0Gr2ZjnirvO+rJ3dA rV0yisVwPPMGZsp4F6VNnKCDiznE7Pi9+Z/vn52jTuraOTdYLRForJ+zRgwr/fog4a+P KsHqTSlwed7ZEzsnGkmOL78xVRFKqef2q/g/1o8z8Odi+tJMJvqUoD44LU4Ai1pTbAc9 1k/niukxCKVbeOKVfI0EqPgtdf2VPSmp8Tv5MnaPew0bqKNyFeiHaNAVKKWBsicbZyda Sq1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Uh9GkB7Ep9TymwPbnm2p7s9g/wKlBS76q/egVLBssNg=; b=wGfvQyW7prvBdDMIpomu+x3PJKqmMyYNFO/aB7aBpseh7eWoduVKOjwaEXuXbsNgFJ yqW3AQKga4YSN1Yyz3vqCapc1Tx2PtfNIMn2nrlim8kMbSsv5zkJqxBSbqM3pDqZcG3g VtYe8MBKVpWbvsMCllnHCGw+31UJvb7RSkedeOF3nZMIXHnURYIZqJ8ZIL0htzDMqwfx HnJ6GwMzNGoR7eXFS/sRq31sw43axiX3qrQBeygXRpExQqIQqsO0GPX5/AeU/UwLMJpF yjnIES+Dkb+Lc5V0TCV8ZRbU74TQ+29TBcVXythYB9UB+kEYHxfiXtiXI1TYWoBbZiG1 lo4A== X-Gm-Message-State: AOAM532MsfU9tQcHL7DiPINpWDjaQKF6pG6rB0QmNFpvWm4EDhDv2zZI HQi3REX/rIjgS9YyjnDD2n0jH20d7RKsMsc3SCyFNQ== X-Google-Smtp-Source: ABdhPJyBjrfEsj17QKvsWW33Z9Ds/DMkv7xs9lOBrkQCyPObuYTp2Dh3dVqsLQrsy1KSVk4H9T5ozg== X-Received: by 2002:a17:906:8cd:: with SMTP id o13mr36568637eje.341.1632255084792; Tue, 21 Sep 2021 13:11:24 -0700 (PDT) Original-Received: from tarsonis ([2a02:2149:8842:bf00:4e17:280e:ca32:e506]) by smtp.gmail.com with ESMTPSA id ec3sm5153833edb.72.2021.09.21.13.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 13:11:24 -0700 (PDT) X-Google-Original-From: "Michalis V." In-Reply-To: <052fb8a67e886712c3e6@heytings.org> (Gregory Heytings's message of "Tue, 21 Sep 2021 19:19:52 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:215036 Archived-At: Gregory Heytings writes: >>> Something like: >>> >>> TMP=$(mktemp -d ./XXXXXXXX) >>> tar -C $TMP -x -z -f $FILE >>> if (($(ls $TMP | wc -l) == 1)) >>> then >>> mv $TMP/* . >>> rmdir $TMP >>> else >>> mv $TMP $(basename $FILE .tar.gz) >>> fi >> >> Wouldn't that remove the files that are in the directory but not in the >> archive? >> > > No, it does what I explained above: > > If all files in the tar file are under one directory (e.g. emacs-27.2.tar.gz > whose files are all in a emacs-27.2 directory), the files will be in that > directory. > > If on the contrary the tar file is "broken" and its files are under multiple > directories or not in a directory (say foobar.tar.gz with three files "/foo", > "/bar" and "/baz"), the files will be put in a directory "foobar". hi Gregory, i've gone down that road with make-temp-file until i realized that i cannot trust that the temporary-file-directory (usually /tmp/ in linux) has enough space to allow such action (e.g. it might be a small ramdisk). But in your example i see you create the temporary dir in the current one where the archive also resides, correct? and i just realized that this is possible in elisp: (let ((temporary-file-directory "/home/mvar/")) (make-temp-file "boing-" t)) without altering the global var. I think this is quite feasible and will give it a try, thank you! Michalis