Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Modifying a directory file

by virtualsue (Vicar)
on Jan 05, 2018 at 14:58 UTC ( #1206758=note: print w/replies, xml ) Need Help??


in reply to Modifying a directory file

Do you know why this person has a file which sounds like it is, frankly, corrupt? If its filename starts with 3 null characters, then I wouldn't necessarily expect the file to contain anything useful. I would immediately suspect that the transfer process, whatever it was, has gone tragically wrong. :-)

Replies are listed 'Best First'.
Re^2: Modifying a directory file
by davidgl (Novice) on Jan 05, 2018 at 17:18 UTC
    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

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1206758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2019-11-19 02:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (93 votes). Check out past polls.

    Notices?