I found a MacOSX bug. Sadly it is either endemic to the design of OSX, or the application is explicitly coded to have this bug.
Anyway. I was viewing several JPGs via the Preview application. I then switched to the Finder and renamed the folder containing those JPGs. At the next opportunity, Preview closed all the image windows.
What should happen in an ideal OS:The images documents should remain open. After all, nothing happened to the documents. They are still on the hard drive. So what if if the user changed zir document arrangement.
What happened in Mac OS9 and earlier:A properly written program referenced the documents by directory id and file name. Changing the folder (directory) name does not change the directory id. Hence the program doesn't even need to be aware of the change.
An improperly written program may have referenced the documents by full path name. Such a program might panic and close the windows when the old full path name no longer works.
OSXI don't how badly OSX gutted the venerable File Manager API. I don't know if the directory id system is still around. Thus I don't know if Preview wad forced to use text based path names, or if it was poorly written, or if the programmer gratuitously decided to close windows who's paths change.
More about an ideal OS:In an ideal OS, users should be able to change the file name of a document even if it is open. File and directory names are for a user's benefit. They should not be for the computer's benefit. (Actually, it is can be unsafe to internally rely upon user chosen names. For example, names may sort differently depending on the language the user is using at the moment.)
Sadly even the original Mac OS was partially infected by legacy operating systems' concept of referencing by name. A properly written old Mac OS program would need to keep files "open" (if just in read mode) so that the Finder could at least disallow renaming of the files that are in use.