You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in the exists function. The function will always return false if you create the Object with
new TemporaryDirectory()->name($tempName); and call the function before you call the create method.
The reason is, you set the location (in my example empty) to the temporary directory inside the create method. if you call exists BEFORE create than you check with an empty location and create creates with tempdir as location.
the same with $this->name
Solution:
the exists method should also set the attributes if they are empty...
as a workaround i wrote
(new TemporaryDirectory(rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR)))->name($tempName);
This discussion was converted from issue #78 on October 24, 2023 06:26.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There is a bug in the exists function. The function will always return false if you create the Object with
new TemporaryDirectory()->name($tempName); and call the function before you call the create method.
The reason is, you set the location (in my example empty) to the temporary directory inside the create method. if you call exists BEFORE create than you check with an empty location and create creates with tempdir as location.
the same with $this->name
Solution:
the exists method should also set the attributes if they are empty...
as a workaround i wrote
(new TemporaryDirectory(rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR)))->name($tempName);
bit this is not the final solution i think ;-)
Beta Was this translation helpful? Give feedback.
All reactions