all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Copying files with dired preserving structure
@ 2016-01-05 17:03 Alberto Luaces
  0 siblings, 0 replies; 3+ messages in thread
From: Alberto Luaces @ 2016-01-05 17:03 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I want to classify some files contained in a directory hierarchy into
several groups, depending on their content.

So far I do a 'find-dired' to get a list of the available files and then
I mark each group by grepping into the files
(dired-mark-files-containing-regexp).

The problem is that if I try now to move those files elsewhere, the
hierarchy is lost, and besides that, files with the same name are
overwritten.

I have tried to "tar" the marked files to preserve the hierarchy, but
this approach is somewhat fragile, as I tend to use incorrect tar flags
and I risk corrupting my work when updating some of those "groups".

I am looking for a way to move marked files to a different place
preserving the directory structure with dired.

Thanks,

-- 
Alberto




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Copying files with dired preserving structure
       [not found] <mailman.1758.1452013450.843.help-gnu-emacs@gnu.org>
@ 2016-01-10  5:06 ` Martin
  2016-01-11  9:24   ` Alberto Luaces
  0 siblings, 1 reply; 3+ messages in thread
From: Martin @ 2016-01-10  5:06 UTC (permalink / raw)
  To: help-gnu-emacs


Alberto Luaces writes:

> Hi,
>
> I want to classify some files contained in a directory hierarchy into
> several groups, depending on their content.
>
> So far I do a 'find-dired' to get a list of the available files and then
> I mark each group by grepping into the files
> (dired-mark-files-containing-regexp).
>
> The problem is that if I try now to move those files elsewhere, the
> hierarchy is lost, and besides that, files with the same name are
> overwritten.
>
> I have tried to "tar" the marked files to preserve the hierarchy, but
> this approach is somewhat fragile, as I tend to use incorrect tar flags
> and I risk corrupting my work when updating some of those "groups".
>
> I am looking for a way to move marked files to a different place
> preserving the directory structure with dired.
>
> Thanks,

Hi,

you may want to use dired-do-(async-)shell-command with
"cp ? --parents <target directory>".

Martin


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Copying files with dired preserving structure
  2016-01-10  5:06 ` Copying files with dired preserving structure Martin
@ 2016-01-11  9:24   ` Alberto Luaces
  0 siblings, 0 replies; 3+ messages in thread
From: Alberto Luaces @ 2016-01-11  9:24 UTC (permalink / raw)
  To: help-gnu-emacs

Martin writes:

> Alberto Luaces writes:
>
>> Hi,
>>
>> I want to classify some files contained in a directory hierarchy into
>> several groups, depending on their content.
>>
>> So far I do a 'find-dired' to get a list of the available files and then
>> I mark each group by grepping into the files
>> (dired-mark-files-containing-regexp).
>>
>> The problem is that if I try now to move those files elsewhere, the
>> hierarchy is lost, and besides that, files with the same name are
>> overwritten.
>>
>> I have tried to "tar" the marked files to preserve the hierarchy, but
>> this approach is somewhat fragile, as I tend to use incorrect tar flags
>> and I risk corrupting my work when updating some of those "groups".
>>
>> I am looking for a way to move marked files to a different place
>> preserving the directory structure with dired.
>>
>> Thanks,
>
> Hi,
>
> you may want to use dired-do-(async-)shell-command with
> "cp ? --parents <target directory>".

Great! It does the trick!

Thank you, Martin.

-- 
Alberto




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-11  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1758.1452013450.843.help-gnu-emacs@gnu.org>
2016-01-10  5:06 ` Copying files with dired preserving structure Martin
2016-01-11  9:24   ` Alberto Luaces
2016-01-05 17:03 Alberto Luaces

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.