bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47058: 28.0.50; Dired Z: insert-directory: Reading directory: No suc


From: Eli Zaretskii
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 21:43:55 +0300

> Date: Tue, 21 Sep 2021 18:38:52 +0000
> From: Gregory Heytings <gregory@heytings.org>
> cc: Eli Zaretskii <eliz@gnu.org>, "Michalis V." <mvar.40k@gmail.com>, 
>     mcenturion@fing.edu.uy, 47058@debbugs.gnu.org, arthur.miller@live.com
> 
> Would it not be easier to unconditionally untar the contents in a 
> temporary directory, and to either move its contents to the current 
> directory if it contains only one entry, or to rename it to a directory 
> based on the tar file name when it contains more than one entry? 

Easier in what sense?

> 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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]