candera / hobocopy

An open source backup tool for Windows
http://candera.github.com/hobocopy/
MIT License
176 stars 52 forks source link

Source directory name is not copied only contents #3

Open candera opened 13 years ago

candera commented 13 years ago

Migrated from SourceForge: https://sourceforge.net/tracker/?func=detail&aid=2098906&group_id=117783&atid=679446

It is odd that the source directory name is not copied only its contents and if you want the source directory name, you need to explicitly put it as part of the destionation path. This may be the desired behavior in some situations but there should be at least a command line switch asking it create the name of the source directory at the destination.

example:

C:>hobocopy /full /skipdenied /y /r "c:\Program Files\Transparent" f:\temp3 HoboCopy (c) 2006 Wangdera Corporation. hobocopy@wangdera.com

dir "c:\Program Files\Transparent" Volume in drive C has no label. Volume Serial Number is 6095-DF7D

Directory of c:\Program Files\Transparent

05/04/2008 01:51 PM

. 05/04/2008 01:51 PM .. 01/30/2006 09:50 PM Before You Know It 3.5 05/04/2008 01:51 PM Before You Know It 3.6 01/04/2008 08:02 PM LanguageNow! 0 File(s) 0 bytes 5 Dir(s) 34,039,865,344 bytes free

F:>dir temp3 Volume in drive F has no label. Volume Serial Number is 5893-0797

Directory of F:\temp3

09/07/2008 11:07 AM

. 09/07/2008 11:07 AM .. 09/07/2008 11:06 AM Before You Know It 3.5 09/07/2008 11:07 AM Before You Know It 3.6 09/07/2008 11:07 AM LanguageNow!

I would have guessed like cp or copy that instead there would be a directory under temp3 named transparent, which contained those files as a subdirectory. I understand this is not the way it was designed to work but there should at least be an option to do do this so you don't have to continually copy the dest directory in as your new dest directory for it to create.

candera commented 13 years ago

Hobocopy is patterned after robocopy. Running

robocopy C:\temp\foo C:\temp\bar

Results in a new directory C:\temp\bar that has the same contents as foo. While I realize that this is perhaps surprising given the semantics of cp and copy, I'm going to change this from a bug report to a feature request to make it an option as you suggest.

Thanks for the input! It is much appreciated!