Comments (4)
@Rafiuth Thank you so much for the thorough investigation. This really seems interesting, if something like std::filesystem::exists()
fails for such a use case.
I've just been trying to isolate if the issue only persists for network shares, and so far it seems that mounting the directory as a shared folder in VMware seems to no longer throw that error. I'll be watching it though, as it happened quite infrequently. This way it's still a "network" drive, but probably uses a different protocol than SMB.
from soggfy.
The "directory name is invalid" error is a bit weird, I don't think it's because of the \\?\
prefix because from what i've seen it was supported before win10. Did you ever see a check mark before on the playlist tracks?
Also, is C:\shortcuts\raid10
a symlink to the netshare or just a normal directory?
from soggfy.
@Rafiuth I created the symlink C:\shortcuts\raid10
pointing to a network share in hopes of fixing the issue. Using \\<ip>\raid10\Music
had the same issue.
I do see checkmarks and most songs are able to be downloaded. The error just seems to happen for a few select songs.
from soggfy.
I've managed to reproduce this issue (or at least a related one) using a Samba server on WSL, but I didn't find a solution. You could workaround it by saving to some temporary path inside the VM and copying it to the NAS later.
Apparently, after calling std::filesystem::exists()
on some existing file, the directory containing that file will no longer be recognized as a directory for some period of time. When Soggfy tries to save a track, the create_directories() call will throw an exception because it thinks that the path is a file and not a directory. The exception should be caught and logged as [ERR] Failed to save track
, but it just crashes Spotify for me. I believe it also causes the "invalid directory name" error.
I've isolated a minimal repro which works most of the time, but the bug could be anywhere on the MSVC STL, Windows or Samba (most likely?):
//`Z:\` is a mounted netshare to a samba server running on WSL.
#include <fstream>
#include <iostream>
#include <filesystem>
#include <Windows.h>
namespace fs = std::filesystem;
int main(int argc, char* argv[]) {
if (argc == 2) {
fs::create_directories("Z:/Folder1/Folder 2");
std::ofstream("Z:/Folder1/Folder 2/File 1.txt", std::ios::binary | std::ios::trunc) << "Hello World";
}
std::cout << "AttrsBefore: " << GetFileAttributesW(L"Z:/Folder1/Folder 2") << "\n";
std::cout << "Exists: " << fs::exists("Z:/Folder1/Folder 2/File 1.txt") << "\n";
std::cout << "AttrsAfter: " << GetFileAttributesW(L"Z:/Folder1/Folder 2") << "\n";
return 0;
}
Output:
E:\repro>cl /std:c++17 Main.cpp
E:\repro>Main.exe a
AttrsBefore: 32
Exists: 1
AttrsAfter: 32
E:\repro>Main.exe
AttrsBefore: 16
Exists: 1
AttrsAfter: 16
E:\repro>Main.exe
AttrsBefore: 16
Exists: 1
AttrsAfter: 32
(about 30s wait between each run)
As per spec, 32=FILE_ATTRIBUTE_ARCHIVE and 16=FILE_ATTRIBUTE_DIRECTORY.
from soggfy.
Related Issues (20)
- update 2.7.2 and spicetify issue HOT 1
- error message told me that i might be using the wrong version despite using the correct one HOT 2
- spotify error HOT 1
- Simultaneously Install Spotify Classic and Microsoft Store Version
- Only OGG Donloading?? HOT 1
- How do I configure it after I've installed i?
- can't install on mac HOT 1
- Windows explorer thinks that the exported .ogg files are at 1411 kbps, when they are actually at 320 kbps
- Extension
- MP3 conversion
- Update HOT 2
- oi darkskeleton HOT 3
- Error: Couldn't find target process in 2.7.1 HOT 3
- [Feature Request] create artist and album folder HOT 1
- 2.7.1 Injector absolutely does not work HOT 11
- Error with uninstalling HOT 1
- Issue with the downloading path
- Set spotify quality to "very high" when it's not available HOT 3
- Installation is successful "Everything is okay", but songs are not downloaded, no folder is there. HOT 8
- Path settings for portable or sandbox operation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soggfy.