in reply to [OT] rename(2) -- renaming file to itself produces no error.

Actually, in KDE, rename doesn't give many errors at all, not for permission issues, if the file doesn't exist, or if your renaming a file to the same name. For the why question if your doing this in a shell, esp. one run by nightly/daily operators, you don't want errors like "couldn't rename so and so" displaying if these files are only created on certain days. If you want an error code use mv or add some manual checking to your script.

"Pain is weakness leaving the body, I find myself in pain everyday" -me

  • Comment on Re: [OT] rename(2) -- renaming file to itself produces no error.

Replies are listed 'Best First'.
Re: Re: [OT] rename(2) -- renaming file to itself produces no error.
by dmitri (Priest) on Jan 07, 2004 at 23:07 UTC
    Umm, I am talking C code here. A project in which a logical error crept up and was not detected because of this weird (to me) behavior. A production system. With junk code in it, which should not be there.