www.delorie.com/gnu/docs/zlibc/zlibc_6.html   search  
 
Buy GNU books!


Zlibc

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.1.1 Symbolic links

After compressing your datafiles, you also need to change any potential symbolic links pointing to them. Let's suppose that `x' is a symlink to `tstfil':

 
> echo 'this is a test' >tstfil
> ln -s tstfil x
> ls -l
total 1
-rw-r--r--   1 alknaff  sirac          15 Feb 25 19:40 tstfil
lrwxrwxrwx   1 alknaff  sirac           8 Feb 25 19:40 x -> tstfil

After compressing it, you'll see the following listing:

 
> gzip tstfil
> ls -l
total 1
pr--r--r--   1 alknaff  sirac          15 Feb 25 19:40 tstfil
lrwxrwxrwx   1 alknaff  sirac           8 Feb 25 19:40 x -> tstfil

`Tstfil' is now shown as a pipe by zlibc in order to warn programs that they cannot seek in it. Zlibc still shows it with its old name, and you can directly look at its contents:
 
> cat tstfil
this is a test

However, `tstfil' is not yet accessible using the symbolic link:
 
> cat x
cat: x: No such file or directory

In order to make `tstfil' accessible using the link, you have to destroy the link, and remake it:
 
> rm x
/bin/rm: remove `x'? y
> ln -s tstfil x
> ls -l
total 1
pr--r--r--   1 alknaff  sirac          15 Feb 25 19:40 tstfil
lrwxrwxrwx   1 alknaff  sirac           8 Feb 25 19:44 x -> tstfil
> cat x
this is a test


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003