Spaces:
Build error
Build error
Download reascripts/common/libs/Tempfile.lua from TechAudio/ReaSpeech-Cloud: direct link, hf CLI and curl.
- Browser
- Download file 544 Bytes
-
https://huggingface.co/spaces/TechAudio/ReaSpeech-Cloud/resolve/main/reascripts/common/libs/Tempfile.lua
- Command line
-
hf download hf://spaces/TechAudio/ReaSpeech-Cloud/reascripts/common/libs/Tempfile.lua
-
curl -L -o Tempfile.lua https://huggingface.co/spaces/TechAudio/ReaSpeech-Cloud/resolve/main/reascripts/common/libs/Tempfile.lua
544 Bytes
| --[[ | |
| Tempfile.lua - Temporary filename creator | |
| ]]-- | |
| Tempfile = { | |
| _names = {} | |
| } | |
| function Tempfile:name() | |
| if reaper.GetOS():find("Win") then | |
| return self:_add_name(os.getenv("TEMP") .. os.tmpname()) | |
| else | |
| return self:_add_name(os.tmpname()) | |
| end | |
| end | |
| function Tempfile:remove(name) | |
| if os.remove(name) then | |
| self._names[name] = nil | |
| end | |
| end | |
| function Tempfile:remove_all() | |
| for name, _ in pairs(self._names) do | |
| os.remove(name) | |
| end | |
| end | |
| function Tempfile:_add_name(name) | |
| self._names[name] = true | |
| return name | |
| end | |