I use both a Mac running OS X and a PC running Windows and sometimes the differences between the way they work can catch you out. It happened recently and I have only just realised what has been going on.
The Windows part of the website is created on a Windows PC and the Mac part is created on a Mac. Of course, I could simply use one or the other to do the whole website, but it's useful to experience both platforms because I write about both the PC and the Mac.
I keep a copy of the website in a folder on each computer. On the PC it's the htdocs folder in C:\Xamp (Xamp is a web server based on Apache and is handy for testing), on the Mac it is also the htdocs folder, but this time it's in Applications\Mamp (Mamp is a web server based on Apache and is handy for testing). The problem is how to keep them in sync.
One way is to drag the htdocs folder to a USB memory drive, take it to the other computer and drag it off. It can be done over the network too. The way Windows and OS X works when you do something like this has caught me out and files have been going missing on the Mac. Is it a feature or a bug?
If you drag a group of files and folders from one place and drop them on another place there is a conflict if the destination contains files or folders with the same names. Both Windows and OS X ask you if you want to replace the destination files and folders with the source, which is fine, but Windows and OS X work differently.
The problem is with subfolders. When the source and destination both contain a subfolder with the same name Windows asks if you want to replace the destination with the source. If you say yes, then the files in the source subfolder are copied to the destination subfolder and files with the same name are overwritten. Files with different names are kept. What you end up with is a folder that combines the files from the source and destination. This is exactly what I wanted.
Do this in OS X and you are asked if you want to replace the subfolder. If you say yes then the folder in the destination is deleted and replaced by the source folder. It really is deleted and it's not moved the the Trash. What you end up with is not a combined folder that contains files from both the source and destination, but just the source.
This isn't what I wanted. and it's how I have been losing files. I assumed OS X would only replace the files in the subfolder with the ones I'm copying from the PC, leaving the ones I'd created on the Mac, so I'd end up with a synced folder. Instead files I'd created for the Mac part of the website were being deleted because the subfolder was being deleted and replaced.
This is obviously something you need to be wary of when copying files and folders to update a destination folder.
Tuesday, 10 February 2009
Weird Mac file copy bug - or is it a feature?
Posted on 01:58 by Unknown
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment