Rixstep
 About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Home » Learning Curve

3662262—2

Some things change; some stay the same.
 - C Hynde


Get It

Try It

Three years ago to the day on Thursday the first article in this series was published. There are some new twists today but overall the situation is still rather - twisted.

If you haven't read the first article in this series yet then do it now before proceeding.

Preliminaries

The first experiment is much as before but with a few new twists.

  1. Make a screen dump with ⇧⌘4. This creates 'Picture 1.png' in your 'Desktop' directory.

  2. Double-click 'Picture 1.png' to open it in Preview.

  3. Open Terminal, go to your desktop ('cd ~/Desktop') and type in the following.

    ln 'Picture 1.png' 'Picture 2.png'

  4. Go back to Preview, rotate the image, and then hit ⌘S (Save).

  5. Now you know for a fact you haven't renamed the file - you've just added a link to it. So what's this gibberish from Apple's file system?

  6. So go ahead - click on 'Save'. Take a chance.

  7. What happens now? You're sorta stuck, aren't you?

  8. OK, back to your Terminal, and presuming you have Rixedit do the following. Otherwise jump to #10.

    mv 'Picture 1.png' 'Picture 1.rtx'

  9. Now double-click 'Picture 1.rtx' to open it, select all, type in a single character (any key is fine) and try to save.

  10. Now back to your Terminal again, rename 'Picture 1.rtx' to 'Picture 1.txt', double-click to open in TextEdit, select all, replace with a single character, and save.

And now just to make sure you're still all right: reboot into single user mode and use fsck to check your file system. And when you're back up and online come back to this page again.

Followups

This next experiment involves only Terminal. So open Terminal and get ready.

  1. Go to your desktop.

    cd ~/Desktop

  2. Create a new folder 'Test' and move into it.

    mkdir Test; cd Test

  3. Type in the following.

    echo 'This is a text file.' >1.txt

  4. Check what you have. Note especially the number in the leftmost column. Check the file contents too.

    $ ls -il
    total 8
    3046457 -rw-r--r-- 1 rixstep staff 21 Jun 18 21:06 1.txt
    $ cat 1.txt
    This is a text file.

  5. Hard link '1.txt' to '2.txt' and check again.

    $ ln 1.txt 2.txt
    $ ls -il
    total 16
    3046457 -rw-r--r-- 2 rixstep staff 21 Jun 18 21:06 1.txt
    3046457 -rw-r--r-- 2 rixstep staff 21 Jun 18 21:06 2.txt


    And note in the above that it's not only the inodes that are identical - all the file information is identical.

    $ ls -ilT
    total 16
    3046457 -rw-r--r-- 2 rixstep staff 21 Jun 18 21:06:09 2007 1.txt
    3046457 -rw-r--r-- 2 rixstep staff 21 Jun 18 21:06:09 2007 2.txt

  6. Check the contents of 'both files' again.

    $ cat 1.txt
    This is a text file.
    $ cat 2.txt
    This is a text file.

  7. Change the contents of '1.txt'; then check the contents not of '1.txt' but of '2.txt'.

    $ echo 'This is not the file it used to be.' >1.txt
    $ cat 2.txt
    This is not the file it used to be.
    $ ls -ilT
    total 16
    3046457 -rw-r--r-- 2 rixstep staff 36 Jun 18 21:19:20 2007 1.txt
    3046457 -rw-r--r-- 2 rixstep staff 36 Jun 18 21:19:20 2007 2.txt

See Also
Learning Curve: 3662262 — Back to HFS

About | ACP | Buy | Industry Watch | Learning Curve | News | Products | Search | Substack
Copyright © Rixstep. All rights reserved.