<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Edit a file without changing the inode number in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/edit-a-file-without-changing-the-inode-number/m-p/3964882#M27488</link>
    <description>When u edit a file in unix the inode number changes.&lt;BR /&gt;Is there any way to edit a file without changing the inode number???</description>
    <pubDate>Tue, 20 Mar 2007 00:32:45 GMT</pubDate>
    <dc:creator>MathanSankar</dc:creator>
    <dc:date>2007-03-20T00:32:45Z</dc:date>
    <item>
      <title>Edit a file without changing the inode number</title>
      <link>https://community.hpe.com/t5/operating-system-linux/edit-a-file-without-changing-the-inode-number/m-p/3964882#M27488</link>
      <description>When u edit a file in unix the inode number changes.&lt;BR /&gt;Is there any way to edit a file without changing the inode number???</description>
      <pubDate>Tue, 20 Mar 2007 00:32:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/edit-a-file-without-changing-the-inode-number/m-p/3964882#M27488</guid>
      <dc:creator>MathanSankar</dc:creator>
      <dc:date>2007-03-20T00:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Edit a file without changing the inode number</title>
      <link>https://community.hpe.com/t5/operating-system-linux/edit-a-file-without-changing-the-inode-number/m-p/3964883#M27489</link>
      <description>Hrm, weird.  Never knew that one..&lt;BR /&gt;&lt;BR /&gt;Quick (hack) fix:  Make a hard-link to it ('ln &lt;FILE&gt; &lt;HOLDER&gt;'). As the inode reference count will be &amp;gt; 1, it won't destroy the file, and re-create it, it'll use the in-place inode (as it's referenced).&lt;BR /&gt;&lt;BR /&gt;That being said, I guess it depends on the editor you use, or what you're trying to do with the file.&lt;BR /&gt;&lt;BR /&gt;What editor do you use? (I tested with 'vim').&lt;/HOLDER&gt;&lt;/FILE&gt;</description>
      <pubDate>Tue, 20 Mar 2007 01:05:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/edit-a-file-without-changing-the-inode-number/m-p/3964883#M27489</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2007-03-20T01:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Edit a file without changing the inode number</title>
      <link>https://community.hpe.com/t5/operating-system-linux/edit-a-file-without-changing-the-inode-number/m-p/3964884#M27490</link>
      <description>Thanks stuart... It works...</description>
      <pubDate>Tue, 20 Mar 2007 03:46:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/edit-a-file-without-changing-the-inode-number/m-p/3964884#M27490</guid>
      <dc:creator>MathanSankar</dc:creator>
      <dc:date>2007-03-20T03:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Edit a file without changing the inode number</title>
      <link>https://community.hpe.com/t5/operating-system-linux/edit-a-file-without-changing-the-inode-number/m-p/3964885#M27491</link>
      <description>I think it would depend a bunch on the exact implementation of the editor chosen, and some 'luck' as well.&lt;BR /&gt;&lt;BR /&gt;What Linux? What version? What Editor?&lt;BR /&gt;&lt;BR /&gt;For details on what the editor exactly does use 'strace editor small-file' and study the lines after the exit commands. (Watch in horror all the 'stuff' that is being done before you get control of thr screen! :-)&lt;BR /&gt;&lt;BR /&gt;Here, on my dinky 'thin client' with a Linux 2.4.25 theeditor of choice is vi and is implemented in busybox. The output file is created as:&lt;BR /&gt;&lt;BR /&gt;open("xy", O_WRONLY|O_CREAT|O_TRUNC, 0664) = 3&lt;BR /&gt;write(3, "....&lt;BR /&gt;&lt;BR /&gt;So if anything goes wrong, the data is destroyed already.&lt;BR /&gt;I could imagine other editors, perhaps doing a create on a new output file first, using a unique temp name, and then when this is succesfully write rename it to the real output, blowing away the original implicitly or explicitly with unlink.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Hein van den Heuvel&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Mar 2007 08:56:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/edit-a-file-without-changing-the-inode-number/m-p/3964885#M27491</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-20T08:56:11Z</dc:date>
    </item>
  </channel>
</rss>

