Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 12-20-2021, 10:00 AM   #1
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 5,649
Default API: GetUserFileNameForRead isn't as separator-agnostic as other API/Lua-functs are

I've run into a problem with GetUserFileNameForRead in Lua.

On Windows, it looks like GetUserFileNameForRead has problems with paths that have / in them, unlike all other functions.

For instance, the following code doesn't open the Cockos folder in the scripts-folder:

Code:
C=reaper.GetResourcePath().."/Scripts/Cockos/"
A,B=reaper.GetUserFileNameForRead(C, "Select a filename to check", "*.lua")
I need to convert all / into \\ first for it to work:

Code:
C=reaper.GetResourcePath().."/Scripts/Cockos/"

C=string.gsub(C, "/", "\\") -- conversion

A,B=reaper.GetUserFileNameForRead(C, "Select a filename to check", "*.lua")
This somehow breaks Lua's behavior of being agnostic of the separator, including Reaper's own functions like
RecursiveCreateDirectory, EnumerateFiles or EnumerateSubdirectories, etc.

Tested on Windows 7 and Reaper 6.43rc4
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Old 12-20-2021, 06:04 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 14,646
Default

Fixing, thanks!
Justin is offline   Reply With Quote
Old 12-21-2021, 10:51 AM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 5,649
Default

Thanks
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.