Test that file operations on directories fail

On some platforms the OS itself does not enforce this