Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Modifying a directory file

by dave_the_m (Monsignor)
on Jan 05, 2018 at 22:10 UTC ( #1206788=note: print w/replies, xml ) Need Help??

in reply to Modifying a directory file

If it was me, I would just move/rename the directory itself somewhere out of the way on the same filesystem, then create a new dir with the correct name and permissions, and move all the files, except the impossible one, back to the new directory.

If you *really* need to actually fix the directory entry, then a quick+dirty solution would be to treat the filesystem's raw device as a block file (i.e. the OSX equivalent of Linux's /dev/sda, whatever that is), then if the file name is distinct enough (e.g. "\0\0\0\0some_long_name"), search for that text within the device, and if it's only found once, then rewrite the block holding that string with the \0's replaced with X or whatever (Preferably done with the filesystem unmounted).


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2021-02-28 19:05 GMT
Find Nodes?
    Voting Booth?

    No recent polls found