On Tue, Dec 02, 2008 at 04:26:56PM +0100, Damian Stewart wrote: > 1. hfsplus filesystem allows opendir() on plain files. > > 2. When opendir() is called on a plain file stored in an hfsplus > filesystem, opendir() fails to return 0 and set errno to ENOTDIR. Yes, this is a side effect of an intentional behavior. In osx, you can open "file/rsrc" to get the resource fork of "file". This behavior is emulated inside hfsplus on Linux, which means that to some degree every file acts like a directory. There isn't a readdir operation so it's not possible to list these, but it is possible to do a lookup on this specific name. The code path taken by opendir inside the kernel checks inode->i_op->lookup and returns ENOTDIR if this function pointer is not set. We can't fix this without either eliminating this way to open the resource fork or making real changes to the generic Linux code. I'm not sure what would be the appropriate thing to do in this case. Someone on the mailing list is likely to have a strong opinion, so there are likely to be suggestions of one sort or another. Maybe the check in the generic code to decide what is a "directory" should be changed? We could possibly check inode->i_fop->readdir. Brad Boyer flar@xxxxxxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html