Fri - February 28, 2003file replaces folder bugErik
and Bill
disagree that this is a
bug, but I agree with Jon: Allowing a file to copy over and delete a
folder is dangerous. Deleting a folder also deletes it contents, and that's
not at all obvious when a user gets the message
"A newer item named "test" already exists in this location. Do you want to replace it with the older one you are moving?" More subtle is the fact there is a violation of the desktop metaphor used by the Finder. When speaking about physical objects ( i.e. manila folders in file cabinets with dead trees ) , if you put a pamphlet called "Annual Report 2000" into a filing cabinet in which there was already another brochure called "Annual Report 2000" , you might be tempted to throw one out (the older one, likely) to save space. On the other hand, if there was a folder in the cabinet labeled "Annual Report 2000" that had lots of things in it ( photos, proofs, drafts, lawyer's memos, accountants' letters of resignation, etc.), you wouldn't automatically assume you could throw out the folder. More interesting is why Bill and Erik think it is not a bug. Let me guess why: there is a different metaphor for a file system which is ingrained in the programmer mind, which is the tree metaphor. In this metaphor, things are connected to each other in a hierarchy like a tree, which has a root, branches and leaves. In this metaphor it is perfectly natural for a branch to grow in place of a leaf, and for branches to be pruned so that new leaves can grow. Of course, The hierarchical tree metaphor is really useful to us programmers, and indeed the UNIX filesystem is built on this metaphor. But, that's not the Finder's metaphor. Finder should disallow this behaviour, and make the user physically move a folder to the trash. Same Metaphor in AppleScript: I encountered a similar issue over a rather subtle AppleScript syntax distinction recently. A programmer friend was being confounded by AppleScript syntax, trying to write a script that looked like this tell app "Finder" move file "my disk:my folder:the old file name" to file "my disk:my folder:the new file name" end tell In the desktop metaphor, you "move a file to a folder" -- the direct object is the thing to move, and the prepositional phrase marked by "to" is the new container for the object. Of course, this script is bound to fail, because the wrong metaphor was being used. My friend was convinced that when moving computer files (which are of course not physical things and therefore not subject to the sense of the English language) "to" ought to specify the new identity for the file, not the new container. No doubt my friend was expecting something like mv my_disk/my_folder/the_old_file_name my_disk/my_folder/the_new_file_name The next day, a new AppleScript user posted the reverse problem to the applescript-users list, complaining that the natural syntax was not working, and you had to resort to something seemingly arcane to get move to work: The point I was making is that using the mail dictionary command "move" One would think the code would be... move message at mailbox "name" to mailbox "other_name" Final Verdict: Yes it is a bug. Posted: February 28, 2003 0:0 Big Box of Paints Email Comments |
Quick Links
Calendar
Categories
Archives
XML/RSS Feed
Statistics
Total entries in this blog: 102
Total entries in this category: 8 Published On: October 25, 2003 0:28 |