Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #24571

Re: Sometiomes I really LOVE linux.

From Eli the Bearded <*@eli.users.panix.com>
Newsgroups comp.os.linux.misc
Subject Re: Sometiomes I really LOVE linux.
Date 2018-09-25 21:26 +0000
Organization Some absurd concept
Message-ID <eli$1809251726@qaz.wtf> (permalink)
References <pobaeo$o0s$1@dont-email.me> <aMSdnT0ZMq3KpDfGnZ2dnUU7-VfNnZ2d@giganews.com> <eli$1809251127@qaz.wtf> <rpqdnUbmou_l_TfGnZ2dnUU7-bnNnZ2d@giganews.com>

Show all headers | View raw


In comp.os.linux.misc, Robert Heller  <heller@deepsoft.com> wrote:
> Eli the Bearded <*@eli.users.panix.com> wrote:
>> And if you don't do that rename step, and edit a program, unpredictable
> Rename (mv) is really a link (to the new name) and an unlink (remove the old
> name). If there is no need to keep the old program, an rm (unlink) is enough.

'mv', to the same filesystem, is atomic unlike the process you describe
above. 'mv' to a different filesystem is copy + unlink, and not supported
by all versions of 'mv'. (I forget if the process of overwriting a name
is atomic, if 'mv old new' is run while "new" exists, but I'm pretty
sure it is. In any case, rename to the same filesystem is just the
rename() system call, see rename(2). )

I note that I provided an example of something that can't happen in
Windows, editing a program while it is running and an example of a type
of program that will be confused by that, and you have ignored that and
discussed the semantics of what a "rename" is.

>> things happen. It's easiest to do with scripts. In the case of Perl, the
>> interpreter reads the whole thing and then runs, pretty safe. In the
>> case of Bash, it reads it line by line, so if the script changes
>> underneath it, it will likely read the next line from the wrong spot.

To reiterate my point: running programs may have an open filepointer to
read instructions even after startup. If the code in the program changes
after startup, the running program will have undefined behavior, and
possibly fail. When you rename the file, the open file pointer stays
with the original inode, and a new version will be completely isolated.

Elijah
------
why he renames /usr/lib/firefox when installing a new one by hand

Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Sometiomes I really LOVE linux. The Natural Philosopher <tnp@invalid.invalid> - 2018-09-24 19:29 +0100
  Re: Sometiomes I really LOVE linux. Robert Heller <heller@deepsoft.com> - 2018-09-24 15:14 -0500
    Re: Sometiomes I really LOVE linux. Bobbie Sellers <bliss@mouse-potato.com> - 2018-09-24 14:01 -0700
      Re: Sometiomes I really LOVE linux. Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2018-09-24 21:27 +0000
        Re: Sometiomes I really LOVE linux. "Carlos E. R." <robin_listas@es.invalid> - 2018-09-24 22:49 -0400
          Re: Sometiomes I really LOVE linux. Richard Kettlewell <invalid@invalid.invalid> - 2018-09-25 09:08 +0100
          Re: Sometiomes I really LOVE linux. Rich <rich@example.invalid> - 2018-09-25 11:51 +0000
            Re: Sometiomes I really LOVE linux. Richard Kettlewell <invalid@invalid.invalid> - 2018-09-25 14:45 +0100
              Re: Sometiomes I really LOVE linux. Rich <rich@example.invalid> - 2018-09-25 20:22 +0000
                Re: Sometiomes I really LOVE linux. Richard Kettlewell <invalid@invalid.invalid> - 2018-09-26 08:32 +0100
          Re: Sometiomes I really LOVE linux. Robert Heller <heller@deepsoft.com> - 2018-09-25 08:34 -0500
            Re: Sometiomes I really LOVE linux. Eli the Bearded <*@eli.users.panix.com> - 2018-09-25 15:28 +0000
              Re: Sometiomes I really LOVE linux. Robert Heller <heller@deepsoft.com> - 2018-09-25 11:21 -0500
                Re: Sometiomes I really LOVE linux. Eli the Bearded <*@eli.users.panix.com> - 2018-09-25 21:26 +0000
                Re: Sometiomes I really LOVE linux. Robert Heller <heller@deepsoft.com> - 2018-09-25 19:06 -0500
              Re: Sometiomes I really LOVE linux. Rich <rich@example.invalid> - 2018-09-25 20:33 +0000
                Re: Sometiomes I really LOVE linux. Eli the Bearded <*@eli.users.panix.com> - 2018-09-25 23:41 +0000
                Re: Sometiomes I really LOVE linux. Rich <rich@example.invalid> - 2018-09-26 00:51 +0000
  Re: Sometiomes I really LOVE linux. jrg <jeff.g.group@att.net> - 2018-09-24 14:33 -0700
    Re: Sometiomes I really LOVE linux. Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2018-09-24 21:59 +0000

csiph-web