X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestCopyRescaleDicom.cxx;h=54f7d7b81a3fe8a530aec59afbc08bc2799f4a42;hb=96a7eb01d292d604c97ea64112323353a965382e;hp=392e7c27dd3d7f406101111a9507b31913bf92d2;hpb=6b0359d3c073112a5d6a23114d6adb0fff949e7b;p=gdcm.git diff --git a/Testing/TestCopyRescaleDicom.cxx b/Testing/TestCopyRescaleDicom.cxx index 392e7c27..54f7d7b8 100644 --- a/Testing/TestCopyRescaleDicom.cxx +++ b/Testing/TestCopyRescaleDicom.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestCopyRescaleDicom.cxx,v $ Language: C++ - Date: $Date: 2005/02/09 15:06:48 $ - Version: $Revision: 1.15 $ + Date: $Date: 2005/02/09 15:31:15 $ + Version: $Revision: 1.16 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,9 +23,37 @@ //Generated file: #include "gdcmDataImages.h" -bool FileExists(const char *filename); +#ifndef _WIN32 +#include //for access, unlink +#else +#include //for _access on Win32 +#endif -bool RemoveFile(const char *source); +bool FileExists(const char *filename) +{ +#ifdef _MSC_VER +# define access _access +#endif +#ifndef R_OK +# define R_OK 04 +#endif + if ( access(filename, R_OK) != 0 ) + { + return false; + } + else + { + return true; + } +} + +bool RemoveFile(const char *source) +{ +#ifdef _MSC_VER +#define _unlink unlink +#endif + return unlink(source) != 0 ? false : true; +} int CopyRescaleDicom(std::string const &filename, std::string const &output )