pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing the rename gnulib function


From: Ben Pfaff
Subject: Re: Testing the rename gnulib function
Date: Mon, 06 Apr 2009 20:46:22 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Michel Boaventura <address@hidden> writes:

> Ben, how do I make a program to use the rename function from the gnulib, and
> not the native one?
> I will test it today and see what happens with hard links.

Instead of doing that, try compiling the following simple
program, which seem to work OK under mingw and wine:

#include <stdio.h>
#include <stdlib.h>

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

int
main(int argc, char *argv[])
{
  if (argc != 3)
    {
      fprintf (stderr, "usage; %s SOURCE DEST\n", argv[0]);
      return EXIT_FAILURE;
    }

  printf ("renaming %s as %s... ", argv[1], argv[2]);
  if (MoveFileEx (argv[1], argv[2], MOVEFILE_REPLACE_EXISTING))
    printf ("success\n");
  else
    printf ("error %d\n", GetLastError ());

  return 0;
}

-- 
"In the PARTIES partition there is a small section called the BEER.
 Prior to turning control over to the PARTIES partition,
 the BIOS must measure the BEER area into PCR[5]."
--TCPA PC Specific Implementation Specification




reply via email to

[Prev in Thread] Current Thread [Next in Thread]