Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The utils.Glob method can not parse semicolon ; in directories #234

Open
TT-ReBORN opened this issue Oct 20, 2024 · 0 comments
Open

The utils.Glob method can not parse semicolon ; in directories #234

TT-ReBORN opened this issue Oct 20, 2024 · 0 comments

Comments

@TT-ReBORN
Copy link

Hi @TheQwertiest,

a user of mine reported that he has an issue with displaying images and I debugged and found out that SMP's utils.Glob
can not parse the file path if the directory contains a semicolon ;
His directory example: [DSD64_1x] - Aaron Neville - Warm Your Heart [A&M] (1991;2017)

Code to reproduce:

function testGlobWithSemicolon() {
	const testPaths = [
		'C:\\Users\\Administrator\\Desktop\\Music\\[DSD64_1x] - Aaron Neville - Warm Your Heart [A&M] (1991;2017)\\cd.png'
	];

	testPaths.forEach(path => {
		console.log(`Testing path: ${path}`);

		// Ensure the file exists
		if (utils.IsFile(path)) {
			console.log(`File exists: ${path}`);
		} else {
			console.log(`File does not exist: ${path}`);
		}

		// Attempt to list the file using a wildcard
		const results = utils.Glob(path.replace('cd.png', '*'), FileAttributes.Directory);
		if (results.length > 0) {
			console.log('utils.Glob found the following entries:');
			results.forEach(result => console.log(result));
		} else {
			console.log('utils.Glob did not find any entries.');
		}
	});
}

testGlobWithSemicolon();

-TT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant