http://www.perlmonks.org?node_id=1206772


in reply to Re: Modifying a directory file
in thread Modifying a directory file

The file is a hang-over from when his data tree was on a MacOS9 system. Under that OS and earlier the string delimiter was other than NULL, so it would be a legal filename back then. He just wants to delete the file. It is currently in his 'Trash' ( = 'Recycle bin') and emptying it fails. Unfortunately he has been able to create another file of the same name by using the Finder to copy and paste the name, but once set it cannot be replaced.

I don't know how the file was copied from the old OS9 system, but any raw inode level copy would work. It could even be the old OS9 Mac drive.

David

Replies are listed 'Best First'.
Re^3: Modifying a directory file
by virtualsue (Vicar) on Jan 10, 2018 at 11:38 UTC
    Now that you say that the goal is to remove the file, I would try deleting it by inode, bypassing the filename altogether. A combination of ls & find will probably do the job. Web searches should turn up a useful recipe. If that failed, I would cheerfully ignore it in the knowledge that the drive is going to die some day. I'm mildly curious as to how it got to Trash (since files don't tend to originate there, so it was moved there by something). Not curious enough to experiment though. I have a list of quixotic tasks I'm working on already.