diff --git a/src/DATA/TOOLS/GetModificationDate.c b/src/DATA/TOOLS/GetModificationDate.c index 6452451..2f7f491 100644 --- a/src/DATA/TOOLS/GetModificationDate.c +++ b/src/DATA/TOOLS/GetModificationDate.c @@ -3,8 +3,8 @@ * @brief Stand-alone executable
Returns modification date for given VI in DDBase
* * @details GetModificationDate(string *)
-* @arg \c argv[1] Full name of *_times.nc -* +* @arg \c argv[1] Path to VI directory +* @arg \c argv[2] Times file name */ @@ -18,11 +18,6 @@ #include -int DataID, StartID; -double StartStamp; -char StartT[TIMELENGTH]; -size_t count[2] = {1L,TIMELENGTH}; -size_t start[2] = {0L,0L}; /*---------------- NC ERROR --------------------------------------*/ void nc_handle_error(int status) @@ -36,20 +31,27 @@ int main(int argc, char *argv[]) { int status, len; - if (argc < 2){ - fprintf(stderr,"Usage: GetStartTime *_times.nc\n"); + if (argc < 3){ + fprintf(stderr,"Usage: GetModificationDate path_to_vi times_file_name\n"); exit(1); } - // Open VI_times.nc - if ((status = nc_open(argv[1], NC_NOWRITE, &DataID)) != NC_NOERR) - nc_handle_error(status); + char timesPath[512]; + memset(timesPath, 0, 512*sizeof(char)); + strcat(timesPath, argv[1]); + strcat(timesPath, "/"); + strcat(timesPath, argv[2]); + + // Open VI_times.nc + int DataID; + if ((status = nc_open(timesPath, NC_NOWRITE, &DataID)) != NC_NOERR) + nc_handle_error(status); char modificationDate[21]; memset(modificationDate, 0, 21*sizeof(char)); if ((status = nc_get_att_text(DataID, NC_GLOBAL, "ModificationDate", modificationDate)) != NC_NOERR) { struct stat b; - if (!stat(argv[1], &b)) { + if (!stat(timesPath, &b)) { strftime(modificationDate, 21, "%Y-%m-%dT%H:%M:%SZ", localtime( &b.st_mtime)); } } diff --git a/src/DATA/TOOLS/GetReleaseDate.c b/src/DATA/TOOLS/GetReleaseDate.c index e73bfa6..b1c40e4 100644 --- a/src/DATA/TOOLS/GetReleaseDate.c +++ b/src/DATA/TOOLS/GetReleaseDate.c @@ -3,7 +3,8 @@ * @brief Stand-alone executable
Returns release date for given VI in DDBase
* * @details GetReleaseDate(string *)
-* @arg \c argv[1] Full name of *_times.nc +* @arg \c argv[1] Path to VI directory +* @arg \c argv[2] Times file name * */ @@ -69,6 +70,7 @@ int main(int argc, char *argv[]) time_t releaseDate = 0; for (i = 0; i < nb_records; ++i) { count[1] = 32; + start[0] = i; if ((status = nc_get_vara_text(DataID, FileID, start, count, FileName)) != NC_NOERR) nc_handle_error(status); memset(filePath, 0, 512*sizeof(char)); diff --git a/src/DATA/TOOLS/TimesUpdate.c b/src/DATA/TOOLS/TimesUpdate.c index 50159f0..eae40a4 100755 --- a/src/DATA/TOOLS/TimesUpdate.c +++ b/src/DATA/TOOLS/TimesUpdate.c @@ -451,6 +451,14 @@ main(int argc, char **argv) } // CASE } // For several arguments + char modificationDate[21]; + memset(modificationDate, 0, 21*sizeof(char)); + + int modDateAttrib; + if ((status = nc_inq_attid(tmID, NC_GLOBAL, "ModificationDate", &modDateAttrib)) != NC_NOERR) { + updateModificationDate = 1; + } + if (updateModificationDate == 1) { char modificationDate[21]; memset(modificationDate, 0, 21*sizeof(char)); diff --git a/src/DDSERVICES/SOAP/DDserverWeb.php b/src/DDSERVICES/SOAP/DDserverWeb.php index 6c88233..a8faea3 100644 --- a/src/DDSERVICES/SOAP/DDserverWeb.php +++ b/src/DDSERVICES/SOAP/DDserverWeb.php @@ -136,7 +136,7 @@ function getVIInfo($viId) $location = $locationNode->nodeValue; $viName = $nameNode->nodeValue; $timesNode = $timesNode->item(0); - $timesFile = $location.$timesNode->nodeValue; + $timesFile = $timesNode->nodeValue; if (!empty($location) && !empty($viName)) { @@ -147,14 +147,14 @@ function getVIInfo($viId) // Release date $releaseDate = NULL; - $cmd = "/opt/tools/DDServer/bin/GetReleaseDate ".$location." ".$timesNode->nodeValue; + $cmd = "/opt/tools/DDServer/bin/GetReleaseDate ".$location." ".$timesFile; $output = array(); exec($cmd, $output, $result_code); if ($result_code == 0) $releaseDate = $output[0]; // Modification date - $cmd = "/opt/tools/DDServer/bin/GetModificationDate ".$timesFile; + $cmd = "/opt/tools/DDServer/bin/GetModificationDate ".$location." ".$timesFile; $output = array(); exec($cmd, $output, $result_code); if ($result_code == 0) -- libgit2 0.21.2