Copy situation
Moderators: Hacker, petermad, Stefan2, white
Copy situation
[face=courier]Directory "Apple" with subdirectory "Orange" opened in one panel, in another panel file "Orange" exists. I copy file "Orange" to "Apple" using explorer ("Ctrl"+"C"/"V"). Dialog appears asking me would I like to replace directory "Orange" with file "Orange" and if I answer "Yes" rather predictable "Error Copying File" occurs. And if I try to do it using TC internal copy routine, Commander copy file "Orange" to "Apple" directory w/o any overwrite messages - at least strange 8). But there is the file, actually? Definitely not in "Orange". It is in the "Apple\Orange".
Well, I didn't ask Commander to copy that file anywhere but to "Apple", so I suppose this situation rather strange. And actually I have to admit explorer behavior in this situation is at least predictable... %\[/face]
Well, I didn't ask Commander to copy that file anywhere but to "Apple", so I suppose this situation rather strange. And actually I have to admit explorer behavior in this situation is at least predictable... %\[/face]
[face=courier]The Protoss do NOT run from their enemies.
It is here, that we shall make our stand.[/face]
It is here, that we shall make our stand.[/face]
- fabiochelly
- Power Member
- Posts: 603
- Joined: 2003-02-05, 12:03 UTC
- Location: Rambouillet, France
In fact, the problems comes from that for copy and move, TC accepts 2 kinds of destination paths:
1. a standard directory path
2. a directory followed by file(s) pattern(s)
In your case, when you ask to copy your file, TC interpret it as a copy to "c:\apple\orange" and it can't guess if this destination is supposed to be a folder or a file pattern.
By default, if the folder orange exists, TC interprets the destination as "c:\apple\orange\*.*" where to copy your file "orange"
I don't know if it is possible to prevent this problem without changing the way TC interprets copy commands.
1. a standard directory path
2. a directory followed by file(s) pattern(s)
In your case, when you ask to copy your file, TC interpret it as a copy to "c:\apple\orange" and it can't guess if this destination is supposed to be a folder or a file pattern.
By default, if the folder orange exists, TC interprets the destination as "c:\apple\orange\*.*" where to copy your file "orange"
I don't know if it is possible to prevent this problem without changing the way TC interprets copy commands.
Fabio Chelly.
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
[face=courier]On 27-07-2003 00:47:45 +0000 fabiochelly wrote:
FC> and it can't guess if this destination is supposed to be a
FC> folder or a file pattern.
Exactly. But in such a situation I want to be asked, actually %).
FC> By default, if the folder orange exists, TC interprets the
FC> destination as "c:\apple\orange\*.*" where to copy your
FC> file "orange"
Yes, and I can't say this interpretation is correct, IMHO.[/face]
FC> and it can't guess if this destination is supposed to be a
FC> folder or a file pattern.
Exactly. But in such a situation I want to be asked, actually %).
FC> By default, if the folder orange exists, TC interprets the
FC> destination as "c:\apple\orange\*.*" where to copy your
FC> file "orange"
Yes, and I can't say this interpretation is correct, IMHO.[/face]
[face=courier]The Protoss do NOT run from their enemies.
It is here, that we shall make our stand.[/face]
It is here, that we shall make our stand.[/face]
AFAIK there can't be two files with the same name (a directory is a file, too) in one dir.I think it is a bug, the file named "Orange" without File Extension should be copied to the folder Apple, but it doesn't.
HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
- fabiochelly
- Power Member
- Posts: 603
- Joined: 2003-02-05, 12:03 UTC
- Location: Rambouillet, France
That's true but in this case, it's not the same dir (if orange is a file, the destination dir is c:\apple\ and if orange is a folder, the dir is c:\apple\orange\).AFAIK there can't be two files with the same name (a directory is a file, too) in one dir
So the confusion come from that when you copy one file with TC, you can copy it to another dir but also as another filename.
Fabio Chelly.
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
#60241
Lorsqu'on s'occupe d'informatique il faut faire comme les canards...
Paraître calme en surface et pédaler comme un forcené par en dessous
- CADweazle
- Senior Member
- Posts: 297
- Joined: 2003-04-03, 09:10 UTC
- Location: Freiburg i.Br. Deutschland
To make things even more complex:
rename in this situation a file orange.txt in dir apple to orange. - what happens? - the directory orange will be replaced by the file orange when the dir is empty and if orange is not empty the file orange will be moved to the dir orange!
So Hacker is right: dirs are treated as files - and vice versa!!
IMO Christian did this special behaviour intentionally - but a request box wouldn't be wrong in this case too...
Greetings, (a member at last
)
rename in this situation a file orange.txt in dir apple to orange. - what happens? - the directory orange will be replaced by the file orange when the dir is empty and if orange is not empty the file orange will be moved to the dir orange!
So Hacker is right: dirs are treated as files - and vice versa!!
IMO Christian did this special behaviour intentionally - but a request box wouldn't be wrong in this case too...

Greetings, (a member at last

Cheer up, Karl
I think the behaviour of TC as described by Black Dog is quite strange or even a bug, because TC changes the target directory implicitly
At least TC should issue a warning.
But in my opinion the behaviour of the Windows Explorer is more reasonable in this point, because files and directories are conceptionally quite different. So if someone really wants to replace a directory by a file with the same name or vice versa then he/she should delete the previous object explicitly.
BTW: In the reverse case (copy/move directory into a directory that already contains a file with same name) TC gives an error message that is not very informative. This message should be improved as well.

But in my opinion the behaviour of the Windows Explorer is more reasonable in this point, because files and directories are conceptionally quite different. So if someone really wants to replace a directory by a file with the same name or vice versa then he/she should delete the previous object explicitly.
BTW: In the reverse case (copy/move directory into a directory that already contains a file with same name) TC gives an error message that is not very informative. This message should be improved as well.
AFAIK everything is a file. A directory is just a file with some dir flag set that contains only the names of other files.A directory is not a file and vice versa
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
From an even lower level view you could argue: Everything is a set of bits. A directory is just a persistent set of bits with ... (add some constraints here) similar to a partition or a file, but that's not the point.Hacker wrote:AFAIK everything is a file. A directory is just a file with some dir flag set that contains only the names of other files.
Conceptionally (from the user view) a directory differs considerably from a file (and a partition). It's just more precisely to say that directories and files share the same namespace on Windows (incl. FAT/NTFS). You can easily imagine that another OS/FS combination does not have this restriction.
jb,
Black Dog.
Anyways, this is what you get when you mix apples and oranges.
Roman
Well, UNIX and Linux do, too.It's just more precisely to say that directories and files share the same namespace on Windows (incl. FAT/NTFS). You can easily imagine that another OS/FS combination does not have this restriction.
Black Dog.
Anyways, this is what you get when you mix apples and oranges.
Roman
[face=courier]On 29-07-2003 12:16:13 +0000 Hacker wrote:
H> Anyways, this is what you get when you mix apples and
H> oranges.
Actually, I'll get a fruit salad :))). Or you wanna say it's even worse than meat and potatoes mix? LOL
BTW still can't get what's wrong with mixing them, looks like a special joke for American internal use... %)[/face]
H> Anyways, this is what you get when you mix apples and
H> oranges.
Actually, I'll get a fruit salad :))). Or you wanna say it's even worse than meat and potatoes mix? LOL
BTW still can't get what's wrong with mixing them, looks like a special joke for American internal use... %)[/face]
[face=courier]The Protoss do NOT run from their enemies.
It is here, that we shall make our stand.[/face]
It is here, that we shall make our stand.[/face]
[face=courier]Well, almost half of a year passed and not a single word from C.G... %\[/face]
[face=courier]The Protoss do NOT run from their enemies.
It is here, that we shall make our stand.[/face]
It is here, that we shall make our stand.[/face]
Today I tried to overwrite a folder 'c:\totalcmd' with my backup 'c:\totalcmd.1' by renaming 'c:\totalcmd.1' - so I wouldn't have to delete the Folder before rename the other.
But it's real annoying - my backup- copy is moved into the other folder. I noticed it only by the speed - it was nearly immedately done.
I think there should be a dialog that asks me if I want to overwrite the existing folder or if I want to move the other one.
sheepdog
But it's real annoying - my backup- copy is moved into the other folder. I noticed it only by the speed - it was nearly immedately done.
I think there should be a dialog that asks me if I want to overwrite the existing folder or if I want to move the other one.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams