Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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).

Dave.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2019-07-20 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?