Bug #17184
closedt3lib_div::tempnam('anything_'); returns invalid path
0%
Description
If you use t3lib_div::tempnam('anything_'); on Windows Vista 64 Bit (didn't check for other systems), you'll recieve an invalid path.
e.g.: C:/Program Files (x86)/typo3/htdocs/typo3wamp/typo3temp/\abcD974.tmp
notice that "/\"
Why does this happen and how can it be solved? Shouldn't there only be \'s on a Windows computer?
OS: Windows Vista 64 Bit Ultimate
executables like csstidy.exe (see sf.net) don't work with such a filename
(issue imported from #M5352)
Updated by Michael Stucki over 17 years ago
I have no such CPU here, so please debug, and make sure it's not a PHP problem.
Updated by Michael Stucki over 17 years ago
1) Check what t3lib_div::tempnam() is doing
2) Paste the contents into a separate PHP file and try the same again
3) As you will see, the PHP function tempnam() is simply called with a path prefix. So you should check how this path looks like...
Updated by Andreas Balzer over 17 years ago
I have found the position of the 'problem'..
In t3lib/class.t3lib_div.php there's the function function tempnam($filePrefix)
The function returns the path, including "typo3temp/"
PHP adds "\" and the filename.. So one slash comes from T3, the other from PHP. Maybe there should be a check, whether there's a slash in the PHP return..
Updated by Michael Stucki over 17 years ago
Look here to see how tempnam() should work: http://ch2.php.net/tempnam
Especially watch the comment of "lreilly at lanl dot gov" at the end of the page.
To me this doesn't look like a TYPO3 issue at all..
Updated by Andreas Balzer over 17 years ago
right, but as M$ won't fix such a thing, it could be implemented into T3. As this seems to be a very important function of T3 it might be useful.. wouldn't it?
Updated by Michael Stucki over 17 years ago
It's not a Microsoft bug, it rather seems like a PHP bug!
Updated by Christian Kuhn over 15 years ago
Resolved, no change required:
- No further feedback for a long time
- Not a TYPO3 bug
Please reopen if this still happens in recent TYPO3 & PHP & Win versions to investigate further.