Page MenuHomePhabricator

Method CreateTemporaryDirectory() of mitk::IOUtil returns strange path names
Closed, ResolvedPublic

Description

There seems to be a problem with the path separators. An example path on my Windows machine is:

C:\Users\franza\AppData\Local\Temp\/G0B3X3

The "\/" in there seems to lead to some problems, e.g., when trying to separate a filename from this directory.

Event Timeline

User franza has pushed new remote branch:

bug-17310-IOUtilCreateTemporaryDirectory

Seems as this bug could be avoided by calling the method with parameters. For example:

mitk::IOUtil::CreateTemporaryDirectory("NavigationToolStorageSerializerTmp_XXXXXX",mitk::IOUtil::GetProgramPath())

returns a valid path!

When, e.g. one "X" is forgotten like here:

mitk::IOUtil::CreateTemporaryDirectory("NavigationToolStorageSerializerTmp_XXXXX",mitk::IOUtil::GetProgramPath())

the path is valid again.

Maybe this helps to fix the bug!

there is a typo in the last commen, in the second case:

"... the path is INvalid again."

There was another problem on the dashboard possibly caused by this bug:

http://cdash.mitk.org/testDetails.php?test=7569768&build=416542

The error message:

.0.14 core.mod.igt.navTlsTorageserializertest ERROR: File access Exception: ..\..\..\..\src\Core\Code\IO\mitkIOUtil.cpp:393:
Creating temporary file C:\Users\admin\AppData\Local\Temp\/mOKWeM failed: Zugriff verweigert

This has actually been fixed in T18107.