From kde-devel Mon Sep 16 15:21:56 2013 From: Andreas Pakulat Date: Mon, 16 Sep 2013 15:21:56 +0000 To: kde-devel Subject: Re: (not only dolphin): Directory doesn't behave as Queue (FIFO) Message-Id: X-MARC-Message: https://marc.info/?l=kde-devel&m=137934495511561 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0888221128169037351==" --===============0888221128169037351== Content-Type: multipart/alternative; boundary=001a11c2c674c73c6a04e681c30e --001a11c2c674c73c6a04e681c30e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, On Mon, Sep 16, 2013 at 4:24 PM, Thomas L=FCbking wrote: > On Montag, 16. September 2013 14:44:15 CEST, Frank Reininghaus wrote: > > Moreover, implementing something like that is far less trivial than >> one might think. >> > > Yesno. The "trick" is to only pass leave paths to the KIO::copy() urls > parameter and resolve dirs to leaves internally by present sort logics. > > It's however the far opposite of efficient - just assume there was a > network invike - and an extreme cornercase, so one should have a dedicate= d > tool (bash script or simple Qt application) to do it. Alternatively simpl= y > mkdir target/folder and copy the contents of the source directory instead > of the directory (what will likely be sufficient in the described case to > get a ripped folder into an mp3 player) > > For a huge singleton copy operation to get an entire collection down, 5-1= 0 > lines bash at max should do. > > Sth. along > dir=3D"`realpath $1`" > for file in `ls -1 --sort=3DBlaFoo` $1; do if [ -d "$file" ]; then $0 > "$dir/$file" "$2"; else cp "$file" "$2/$1/"; fi > If sorting by filename is sufficient Linux actually has a tool for that called fatsort (http://fatsort.sourceforge.net/). It orders the entries in the FAT table based on the filenames and allows to move directories before or after the files as well. Andreas --001a11c2c674c73c6a04e681c30e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

On Mon, Sep 16, 2013 at 4:24 PM, Thomas L=FCbking <= thomas.luebk= ing@gmail.com> wrote:
On Montag, 16. September 2013 14:44:15 C= EST, Frank Reininghaus wrote:

Moreover, implementing something like that is far less trivial than
one might think.

Yesno. The "trick" is to only pass leave paths to the KIO::copy()= urls parameter and resolve dirs to leaves internally by present sort logic= s.

It's however the far opposite of efficient - just assume there was a ne= twork invike - and an extreme cornercase, so one should have a dedicated to= ol (bash script or simple Qt application) to do it. Alternatively simply mk= dir target/folder and copy the contents of the source directory instead of = the directory (what will likely be sufficient in the described case to get = a ripped folder into an mp3 player)

For a huge singleton copy operation to get an entire collection down, 5-10 = lines bash at max should do.

Sth. along
dir=3D"`realpath $1`"
for file in `ls -1 --sort=3DBlaFoo` $1; do if [ -d "$file" ]; the= n $0 "$dir/$file" "$2"; else cp "$file" "= ;$2/$1/"; fi

If sorting by filenam= e is sufficient Linux actually has a tool for that called fatsort (http://fatsort.sourceforge.net/). = It orders the entries in the FAT table based on the filenames and allows to= move directories before or after the files as well.

Andreas
--001a11c2c674c73c6a04e681c30e-- --===============0888221128169037351== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============0888221128169037351==--