Re: Changing hard linked data
Re: Changing hard linked data
- Subject: Re: Changing hard linked data
- From: Tommy Nordgren <email@hidden>
- Date: Tue, 4 Oct 2005 16:33:38 +0200
Oct 4, 2005 kl. 4:14 PM skrev Gerriet M. Denkmann:
I have several hard links (/tmp/a1 and /tmp/a2 and maybe many
others) pointing to some data.
Now I want to edit this data and save it so that my hard links all
point to the changed data.
exchangedata() does not help - it refuses to work with hard links.
Is there some Cocoa (or Unix) way to accomplish this?
I could get the inode with ls -i, could get all other links with
find / -inum nnn -print and do ln -f new_data old_hard_link -- but
I want something easier, more direct, less overhead.
Kind regards,
Gerriet.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40chello.se
This email sent to email@hidden
Try this: Write a copy of your data to a temporary file.
Then open your (hard-linked file in Read-Write mode and copy your
data there.
Then set the logical size to the current file position, neccessary if
new data set is shorter.
Then close the linked file, and verify it aginst the temporary file.
Then finally delete the temporary file.
"Home is not where you are born, but where your heart finds peace" -
Tommy Nordgren, "The dying old crone"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden