• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Changing hard linked data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Changing hard linked data (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: using zlib on OS X
  • Next by Date: Limiting the display of Entities
  • Previous by thread: Changing hard linked data
  • Next by thread: Re: using zlib on OS X
  • Index(es):
    • Date
    • Thread