Commit 161dbca2 authored by claes's avatar claes

dcli_file_time added

parent f042496d
/** /**
* Proview $Id: co_dcli.h,v 1.5 2005-09-01 14:57:52 claes Exp $ * Proview $Id: co_dcli.h,v 1.6 2005-09-21 14:19:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -77,6 +77,7 @@ int dcli_replace_env( char *str, char *newstr); ...@@ -77,6 +77,7 @@ int dcli_replace_env( char *str, char *newstr);
#endif #endif
char *dcli_fgetname( FILE *fp, char *name, char *def_name); char *dcli_fgetname( FILE *fp, char *name, char *def_name);
int dcli_translate_filename( char *out, const char *in); int dcli_translate_filename( char *out, const char *in);
pwr_tStatus dcli_file_time( char *filename, pwr_tTime *time);
/* Functions in module co_dcli_dir */ /* Functions in module co_dcli_dir */
......
/** /**
* Proview $Id: co_dcli_file.c,v 1.4 2005-09-01 14:57:52 claes Exp $ * Proview $Id: co_dcli_file.c,v 1.5 2005-09-21 14:19:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
# include <stdio.h> # include <stdio.h>
# include <stdlib.h> # include <stdlib.h>
# include <unistd.h> # include <unistd.h>
# include <sys/stat.h>
#include "co_cdh.h" #include "co_cdh.h"
#include "co_dcli_msg.h" #include "co_dcli_msg.h"
...@@ -472,5 +473,15 @@ int dcli_translate_filename( char *out, const char *in) ...@@ -472,5 +473,15 @@ int dcli_translate_filename( char *out, const char *in)
} }
pwr_tStatus dcli_file_time( char *filename, pwr_tTime *time)
{
struct stat info;
if ( stat( filename, &info) != -1) {
time->tv_sec = info.st_mtime;
time->tv_nsec = 0;
return DCLI__SUCCESS;
}
return DCLI__NOFILE;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment