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


Groups > comp.lang.c > #12551

Re: undefined reference to `link'

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: undefined reference to `link'
Date 2011-11-02 14:10 -0700
Organization None to speak of
Message-ID <lnwrbigrhb.fsf@nuthaus.mib.org> (permalink)
References <j8p3un$ock$1@dont-email.me> <j8p4g0$rpe$1@dont-email.me> <j8p55i$v4p$1@dont-email.me> <j8p6gh$989$1@dont-email.me> <2e64bfb7-d656-4a54-a5f1-3c0e18243e6b@n38g2000yqm.googlegroups.com>

Show all headers | View raw


jgharston <jgh@arcade.demon.co.uk> writes:
> Mark Bluemel wrote:
>> > yes, the code use link and unlink routines.
>> You need to work out what the link and unlink routines are being used
>> for - I think it's to rename a temporary work file to become an output
>
> If you're using link/unlink to rename a file, the stdio library
> contains
> the standard rename() function.
>
> Always start by looking in your standard libraries for the
> functionality you're looking for before going trekking off in other
> directions.

rename() doesn't do what the Unix link() system call does.

link() creates a new name for a file.  The new name and the old name
both refer to the same file in the same way; neither of them is, in any
real sense, the original.

The C standard library doesn't provide anything with equivalent
functionality -- probably because there's no guarantee that the
underlying OS or filesystem is capable of supporting it.

(I tried using the "ln" command under Cygwin, a Unix emulation layer
that runs on top of MS Windows, and got some odd and inconsistent
results.)

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-01 23:41 +0800
  Re: undefined reference to `link' Mark Bluemel <mark_bluemel@pobox.com> - 2011-11-01 15:46 +0000
    Re: undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-02 00:01 +0800
      Re: undefined reference to `link' Mark Bluemel <mark_bluemel@pobox.com> - 2011-11-01 16:21 +0000
        Re: undefined reference to `link' jgharston <jgh@arcade.demon.co.uk> - 2011-11-02 04:43 -0700
          Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-02 14:10 -0700
            Re: undefined reference to `link' jgharston <jgh@arcade.demon.co.uk> - 2011-11-03 17:08 -0700
              Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-03 17:17 -0700
                Re: undefined reference to `link' gordonb.hsqhk@burditt.org (Gordon Burditt) - 2011-11-03 23:11 -0500
          Re: undefined reference to `link' gordonb.d5wxg@burditt.org (Gordon Burditt) - 2011-11-02 16:28 -0500
            Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-02 15:30 -0700
              Re: undefined reference to `link' gordonb.wk71i@burditt.org (Gordon Burditt) - 2011-11-02 19:33 -0500
                Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-02 19:24 -0700
      Re: undefined reference to `link' Acid Washed China Blue Jeans <chine.bleu@yahoo.com> - 2011-11-01 10:02 -0700
        Re: undefined reference to `link' gordonb.ztlqg@burditt.org (Gordon Burditt) - 2011-11-02 19:46 -0500
          Re: undefined reference to `link' Seebs <usenet-nospam@seebs.net> - 2011-11-03 18:35 +0000
            Re: undefined reference to `link' Kaz Kylheku <kaz@kylheku.com> - 2011-11-03 19:56 +0000
              Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-03 14:04 -0700
              Re: undefined reference to `link' Seebs <usenet-nospam@seebs.net> - 2011-11-03 21:45 +0000
              Re: undefined reference to `link' Acid Washed China Blue Jeans <chine.bleu@yahoo.com> - 2011-11-03 15:53 -0700
      Re: undefined reference to `link' Mike Manilone <zhtx10@gmail.com> - 2011-11-02 04:42 +0000
      Re: undefined reference to `link' Geoff <geoff@invalid.invalid> - 2011-11-03 14:52 -0700
        Re: undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-04 08:19 +0800
          Re: undefined reference to `link' Geoff <geoff@invalid.invalid> - 2011-11-03 21:32 -0700
            Re: undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-04 13:25 +0800
            Re: undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-04 13:28 +0800
              Re: undefined reference to `link' Geoff <geoff@invalid.invalid> - 2011-11-03 23:01 -0700
  Re: undefined reference to `link' Kaz Kylheku <kaz@kylheku.com> - 2011-11-03 02:40 +0000

csiph-web