# HG changeset patch # User Sebastien Jodogne # Date 1453997324 -3600 # Node ID 145e654112d6fc89fbeafaaf6db72ace764cad13 # Parent f395dddfbf1683bfead05f4acf914ca71e0e3753 sync diff -r f395dddfbf16 -r 145e654112d6 Orthanc/Core/Enumerations.cpp --- a/Orthanc/Core/Enumerations.cpp Mon Jan 04 14:27:06 2016 +0100 +++ b/Orthanc/Core/Enumerations.cpp Thu Jan 28 17:08:44 2016 +0100 @@ -897,7 +897,7 @@ std::string s = specificCharacterSet; Toolbox::ToUpperCase(s); - // http://www.dabsoft.ch/dicom/3/C.12.1.1.2/ + // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2 // https://github.com/dcm4che/dcm4che/blob/master/dcm4che-core/src/main/java/org/dcm4che3/data/SpecificCharacterSet.java if (s == "ISO_IR 6" || s == "ISO_IR 192" || @@ -1046,7 +1046,7 @@ const char* GetDicomSpecificCharacterSet(Encoding encoding) { - // http://www.dabsoft.ch/dicom/3/C.12.1.1.2/ + // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2 switch (encoding) { case Encoding_Utf8: diff -r f395dddfbf16 -r 145e654112d6 Orthanc/Core/Enumerations.h --- a/Orthanc/Core/Enumerations.h Mon Jan 04 14:27:06 2016 +0100 +++ b/Orthanc/Core/Enumerations.h Thu Jan 28 17:08:44 2016 +0100 @@ -314,7 +314,8 @@ }; - // http://www.dabsoft.ch/dicom/3/C.12.1.1.2/ + // Specific Character Sets + // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.12.1.1.2 enum Encoding { Encoding_Ascii, @@ -338,7 +339,7 @@ }; - // https://www.dabsoft.ch/dicom/3/C.7.6.3.1.2/ + // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#sect_C.7.6.3.1.2 enum PhotometricInterpretation { PhotometricInterpretation_ARGB, // Retired diff -r f395dddfbf16 -r 145e654112d6 Orthanc/Core/FileStorage/FilesystemStorage.cpp --- a/Orthanc/Core/FileStorage/FilesystemStorage.cpp Mon Jan 04 14:27:06 2016 +0100 +++ b/Orthanc/Core/FileStorage/FilesystemStorage.cpp Thu Jan 28 17:08:44 2016 +0100 @@ -165,7 +165,7 @@ { for (fs::recursive_directory_iterator current(root_), end; current != end ; ++current) { - if (fs::is_regular_file(current->status())) + if (Toolbox::IsRegularFile(current->path().string())) { try { diff -r f395dddfbf16 -r 145e654112d6 Orthanc/Core/Toolbox.cpp --- a/Orthanc/Core/Toolbox.cpp Mon Jan 04 14:27:06 2016 +0100 +++ b/Orthanc/Core/Toolbox.cpp Thu Jan 28 17:08:44 2016 +0100 @@ -127,6 +127,7 @@ } #endif + void Toolbox::USleep(uint64_t microSeconds) { #if defined(_WIN32) @@ -208,7 +209,7 @@ void Toolbox::ReadFile(std::string& content, const std::string& path) { - if (!boost::filesystem::is_regular_file(path)) + if (!IsRegularFile(path)) { LOG(ERROR) << std::string("The path does not point to a regular file: ") << path; throw OrthancException(ErrorCode_RegularFileExpected); @@ -268,7 +269,7 @@ { if (boost::filesystem::exists(path)) { - if (boost::filesystem::is_regular_file(path)) + if (IsRegularFile(path)) { boost::filesystem::remove(path); } @@ -1382,5 +1383,26 @@ return static_cast(getpid()); #endif } + + + bool Toolbox::IsRegularFile(const std::string& path) + { + namespace fs = boost::filesystem; + + try + { + if (fs::exists(path)) + { + fs::file_status status = fs::status(path); + return (status.type() == boost::filesystem::regular_file || + status.type() == boost::filesystem::reparse_file); // Fix BitBucket issue #11 + } + } + catch (fs::filesystem_error&) + { + } + + return false; + } } diff -r f395dddfbf16 -r 145e654112d6 Orthanc/Core/Toolbox.h --- a/Orthanc/Core/Toolbox.h Mon Jan 04 14:27:06 2016 +0100 +++ b/Orthanc/Core/Toolbox.h Thu Jan 28 17:08:44 2016 +0100 @@ -190,5 +190,7 @@ const std::string& prefix); int GetProcessId(); + + bool IsRegularFile(const std::string& path); } }