davidgl has asked for the wisdom of the Perl Monks concerning the following question:
I'm asking this as a result of someone who has an 'impossible' problem on their Mac asking on a Mac list.
They have a file that originated before MacOS X, that is before the Mac OS became Unix based. The first three characters of the filename are NULLs. Needless to say, any Unix function that tries to manipulate that file fails at the name -> inode lookup stage because the filename string terminates at the first char.
I fixed a similar problem around 35 years ago by doing a binary edit on the directory file, but that option is no-longer available, especially on a Mac, so I'm looking at Perl. I am reasonably familiar with Perl, but not an expert.
In Perl I can opendir() and readdir() to find the entry but that doesn't give me the rest of the directory entry structure. If I had that, I could change the name and hopefully re-write the directory file.
Does anyone have any pointers? I can't think of any other group where I would find real 'bit twiddlers'.
Thanks, David
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Modifying a directory file
by dave_the_m (Monsignor) on Jan 05, 2018 at 22:10 UTC | |
Re: Modifying a directory file
by soonix (Canon) on Jan 05, 2018 at 18:38 UTC | |
Re: Modifying a directory file
by Eily (Monsignor) on Jan 05, 2018 at 14:08 UTC | |
by davidgl (Novice) on Jan 05, 2018 at 14:24 UTC | |
Re: Modifying a directory file
by virtualsue (Vicar) on Jan 05, 2018 at 14:58 UTC | |
by davidgl (Novice) on Jan 05, 2018 at 17:18 UTC | |
by virtualsue (Vicar) on Jan 10, 2018 at 11:38 UTC | |
Re: Modifying a directory file
by Anonymous Monk on Jan 05, 2018 at 15:33 UTC | |
by davidgl (Novice) on Jan 05, 2018 at 17:23 UTC |