Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Easily change a filename while the file is being edited' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Easily change a filename while the file is being edited
Authored by: ctwise on Mar 13, '09 10:31:57AM

This isn't an OS/X thing, it's a Unix thing. Unix file systems divorce the file name from the file contents. It's why the operating system call to delete a file is called 'unlink'. The file exists until all of the references to it are gone. You can even delete a file from the file system while a program has it open. It's a common paradigm in Unix programs to create a temporary scratch file, open it and then immediately delete it. No one but the program will have access to the file and it will completely disappear as soon as the program ends. That said, the applications have to be written to expect the name to change - so they can update titlebars, etc. In OS/X it looks like the application frameworks are written to expect this behavior.



[ Reply to This | # ]
Easily change a filename while the file is being edited
Authored by: outZider on Mar 15, '09 11:50:44AM

To be fair, this is an HFS thing as well. Macs since somewhere around the dawn of HFS in 1985 have been able to do this, and this is why Apple's API documentation tells you how to manage files by reference rather than by path. File references follow the file around the filesystem, and those people who ported apps from Windows, or didn't follow API guidelines by referencing a file by path end up breaking this ability in their application.

It's also a handy way to find out if an application was written in REALbasic, as 90% of those guys sit there writing "Macintosh HD:Applications:So On".



[ Reply to This | # ]