Skip to content

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

Description

@TT-ReBORN

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions