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

Reply
 
Thread Tools Display Modes
Old 06-16-2022, 05:57 PM   #1
phoo
Human being with feelings
 
phoo's Avatar
 
Join Date: Dec 2010
Location: Hampstead, NC
Posts: 246
Default Reaper Saves WAV Files with Filenames It Can't Open

Bad form when recording and not catching it will result in wav files that won't be found when the project is reopened.

Bad Form? Working with tracks that have no names.
  1. Create a track
  2. Don't give the track a name at all - leave it blank
  3. Do whatever (MIDI, wave, doesn't matter, add something that will play and can be rendered) Render that track as a stem
  4. The new track name will be " - stem" as it is the original track name with " - stem" appended.
  5. The resulting wav will be named something like "myprojectname_stems-001.wav" (this is irrelevant mostly)
  6. Right-click, and glue the items in that track, even if just the one stem
  7. The underlying glued wav(s) will be named " - stem-glued.wav", " - stem-glued-01.wav", " - stem-glued-02.wav", etc, as they will be the track name and "-glued"
  8. Save and close the project
  9. Reopen the project
  10. Or copy the entire folder, all files to another machine and try to open it. No dice.
  11. Any wav files with names like " - stem-glued.wav" cannot be found.

This may be a long unnecessary repro (sorry - this is how I hit it)

Maybe it's as simple as any WAV files that have a space as the first character of the filename can't be opened which these steps will set up.

Easy to avoid. Always name tracks SOMETHING.

But, the bug is that Reaper can and will save out files with filenames it can't open later.
__________________
Experienced enough to know - Too old to care
https://www.thefartones.com
https://www.phootoons.com
phoo is offline   Reply With Quote
Old 06-16-2022, 06:08 PM   #2
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,927
Default

What OS is this? I can't reproduce any problem following these steps, or generally opening a file named " - stem.wav" on Windows.
schwa is offline   Reply With Quote
Old 06-16-2022, 06:49 PM   #3
phoo
Human being with feelings
 
phoo's Avatar
 
Join Date: Dec 2010
Location: Hampstead, NC
Posts: 246
Default

Windows 10.

A filename with a leading space is perfectly acceptable in Windows. The issue seems to be specific to cold opening a project that has references these files.

I copied the whole project folder, all files, from the desktop to the laptop and the laptop Reaper barfed on those files. All files are in the folder.

Browsing for the files and selecting them one at a time WILL allow them to open.

Heck, it's debatable what the bug is.

Reaper can't find them when the project is opened. Browsing for them works, so you are correct that the file names are legal.

Is there a bug in the initial file opening code? Is something in there stripping the space, looking for the correct file if that space is removed? (Trivial to test and I will.) Maybe, but the track itself references the filename with the space. Testing will let us know what happens if the initial load works but the filename referenced is different.

Is the bug that creating a stem track from an unnamed track results in a track that is named with a leading space? That's the root of the repro. There's nothing wrong with a leading space on a track if nothing else depends on it.

But, in spite of that, a naming convention to blindly uses the track name as-is and appends "-glued" may be a potential bug, as it doesn't check for leading spaces in the track name. Changing this would fix the problem.

Just pondering what-ifs.
__________________
Experienced enough to know - Too old to care
https://www.thefartones.com
https://www.phootoons.com
phoo is offline   Reply With Quote
Old 06-16-2022, 07:00 PM   #4
phoo
Human being with feelings
 
phoo's Avatar
 
Join Date: Dec 2010
Location: Hampstead, NC
Posts: 246
Default

AH AH AH!!!!!!

FOUND A PROBLEM! (the?)

Reaper is NOT saving the glued files with leading spaces.

Reaper IS saving them with NO leading space but when the project is saved and reopened it is looking for the file WITH the leading space.


Full path reference in the project:
"C:\reaper_default\phoo_three\phoo_22_06_12\ - stem-glued.wav"

Full path to the files in the project folder:
"C:\reaper_default\phoo_three\phoo_22_06_12\- stem-glued.wav"
__________________
Experienced enough to know - Too old to care
https://www.thefartones.com
https://www.phootoons.com
phoo is offline   Reply With Quote
Old 06-17-2022, 04:59 AM   #5
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,801
Default

How are you transferring the files from system to system?

Can you follow the minimal steps to reproduce, and when you go to copy the files from the source machine make a zip of the directory, and include a copy of your reaper.ini? Then email a copy of that zip to support at cockos dot com? thanks!

Last edited by Justin; 06-17-2022 at 05:39 AM.
Justin is offline   Reply With Quote
Old 06-17-2022, 08:56 AM   #6
Bob Blacksheep
Human being with feelings
 
Bob Blacksheep's Avatar
 
Join Date: Dec 2018
Posts: 37
Default

Quote:
Originally Posted by phoo View Post
Windows 10.

A filename with a leading space is perfectly acceptable in Windows
Yes and no. Technically you CAN NOT create files that begin with the ascii space character (0x20). But you CAN create files that LOOK LIKE they have spaces. The things you think are spaces are actually called “unicode whitespace characters”.

But wait!

There’s more!

If you use the undocumented function NtCreateFile() in NtDll.dll to create the file then you can do all kinds of weird shit - including creating files that begin with 0x20. You can also create files that begins with ascii null (0x00), and those file will be invisible.

https://docs.microsoft.com/en-us/tro...ace-characters

https://docs.microsoft.com/en-us/win...l-ntcreatefile
Bob Blacksheep is offline   Reply With Quote
Old 06-17-2022, 11:43 AM   #7
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,801
Default

Ah, Windows removes the leading spaces if you copy the file via explorer. We'll make REAPER automatically not create files with leading spaces on Windows.

Quote:
If you use the undocumented function NtCreateFile() in NtDll.dll to create the file then you can do all kinds of weird shit - including creating files that begin with 0x20. You can also create files that begins with ascii null (0x00), and those file will be invisible.
Looks like if you use the \\?\ syntax for file openings (REAPER does, it allows for long filenames too) you can use spaces as the first character of filenames.

Last edited by Justin; 06-17-2022 at 12:05 PM.
Justin is offline   Reply With Quote
Old 06-17-2022, 02:07 PM   #8
phoo
Human being with feelings
 
phoo's Avatar
 
Join Date: Dec 2010
Location: Hampstead, NC
Posts: 246
Default

YES, YES and YES.....

Thanks for getting to this before I did. It is in fact the "copy from system to system" step that horked the project.

The steps to create an unnamed track, stem, and glue, did create a referenced WAV what had what looked like a leading space, regardless of what that character is under the hood. Reaper is happy with that file, as-is.

Copy that project on Windows 10 and the leading space (that non-printable character) on the filename gets stripped off. At that point Reaper can't find it because Windows renamed it to something else. Well...duh!

That was a totally unexpected behavior when moving projects from the desktop in the studio to the laptop.

Let me know if a project is still needed. I assume not.

THANK YOU!!!
__________________
Experienced enough to know - Too old to care
https://www.thefartones.com
https://www.phootoons.com
phoo is offline   Reply With Quote
Old 06-18-2022, 08:26 AM   #9
Bob Blacksheep
Human being with feelings
 
Bob Blacksheep's Avatar
 
Join Date: Dec 2018
Posts: 37
Default

Quote:
Originally Posted by Justin View Post
Looks like if you use the \\?\ syntax for file openings (REAPER does, it allows for long filenames too) you can use spaces as the first character of filenames.
Aha! That makes sense. It never occurred to me.

Fwiw I learned about NtCreateFile() years ago when writing a DirectShow filter to read Sound Designer II files. It allows you read the dot-underscore side-car files that hold the resource fork metadata.
Bob Blacksheep 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 09:50 PM.


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