[LFS Trac] #1728: Chapter 6 - Package Management - Explain why 'install' is generally safer than 'cp'

LFS Trac trac at linuxfromscratch.org
Tue May 2 14:53:18 PDT 2006


#1728: Chapter 6 - Package Management - Explain why 'install' is generally safer
than 'cp'
-----------------------------------------+----------------------------------
 Reporter:  gerard at linuxfromscratch.org  |        Owner:  lfs-book at linuxfromscratch.org
     Type:  enhancement                  |       Status:  new                          
 Priority:  normal                       |    Milestone:  Future                       
Component:  Book                         |      Version:  SVN                          
 Severity:  normal                       |   Resolution:                               
 Keywords:                               |  
-----------------------------------------+----------------------------------
Comment (by dbn.lists at gmail.com):

 Looks like both uses the same inode here, even if the file has been
 altered.

 {{{
 $ /bin/cp -vf inotify.h foo/ && ls -li foo/* && sleep 1 && echo >>
 inotify.h && /bin/cp -vf inotify.h foo/ && ls -li foo/*
 `inotify.h' -> `foo/inotify.h'
 574324 -rwxr-xr-x  1 dnicholson dnicholson 4218 2006-05-02 14:49
 foo/inotify.h
 `inotify.h' -> `foo/inotify.h'
 574324 -rwxr-xr-x  1 dnicholson dnicholson 4219 2006-05-02 14:49
 foo/inotify.h
 $
 $ /bin/install -v inotify.h foo/ && ls -li foo/* && sleep 1 && echo >>
 inotify.h && /bin/install -v inotify.h foo/ && ls -li foo/*
 `inotify.h' -> `foo/inotify.h'
 574324 -rwxr-xr-x  1 dnicholson dnicholson 4219 2006-05-02 14:50
 foo/inotify.h
 `inotify.h' -> `foo/inotify.h'
 574324 -rwxr-xr-x  1 dnicholson dnicholson 4220 2006-05-02 14:50
 foo/inotify.h
 }}}

 Always uses inode 574324.

-- 
Ticket URL: <http://wiki.linuxfromscratch.org/lfs/ticket/1728>
LFS Trac <http://wiki.linuxfromscratch.org/lfs/>
Linux From Scratch: Your Distro, Your Rules.



More information about the lfs-book mailing list