www.digitalmars.com         C & C++   DMDScript  

c++.command-line - Error 42: Symbol Undefined _setftime

reply osimitz utanet.at writes:
Hi, I'm using Symantec C++ 7.2 this is the previous version of md.

I would likr to change the timestamp of a file which I had copied.

In the documentation I found this sample. 

/*   Example for setftime  */

#include <stdio.h>
#include <stdlib.h>
#include <io.h>
#include <dos.h>
#include <fcntl.h>

void evenftime (struct ftime *time)
{
time->ft_tsec = 0;
time->ft_min = 0;
time->ft_hour = 0;
time->ft_day = 1;
}

int dofile (char *fname)
{
int fh;
struct ftime time;
char buffer[128];

if ((fh = _open (fname, _O_RDONLY)) < 0)
{
sprintf (buffer, "Unable to open file: %s", fname);
perror (buffer);
}
printf ("setftime: %s\n", fname);

getftime (fh, &time);
evenftime (&time);
setftime (fh, &time);

_close (fh);
}

void main (int argc, char * argv[])
{
int args;
struct FIND *find;

if (argc < 2)
{
printf ("Usage: SETFTIME filespec [filespec [filespec [...]]]\n");
exit (EXIT_FAILURE);
}

for (args = 1; args < argc; args++)
{
find = findfirst (argv[args], 0);
while (find)
{
dofile (find->name);
find = findnext ();
}
}
}

After compiling the source above with this command:

c:\sc\bin\sc -mn getftime.c snn.lib user32.lib c:\tools\bin\getftime.exe

I always get following error:
Error 42: Symbol Undefined _setftime

does anybody know this problem?

Thanks

Horst

osimitz utanet.at
Jan 01 2006
parent "Walter Bright" <newshound digitalmars.com> writes:
<osimitz utanet.at> wrote in message news:dp8o6o$1r6$1 digitaldaemon.com...
 I always get following error:
 Error 42: Symbol Undefined _setftime

That's because SC doesn't have the setftime() function as part of its library. I don't know why it's in the documentation :-(
Jan 02 2006