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

Windows: Open database on another drive #112

Open
cloakedch opened this issue Oct 28, 2022 · 0 comments
Open

Windows: Open database on another drive #112

cloakedch opened this issue Oct 28, 2022 · 0 comments

Comments

@cloakedch
Copy link

cloakedch commented Oct 28, 2022

How can one open an mbtiles database that is stored on a different drive letter than windows?

Given

new MBTiles(path, (err, mbtiles) => { console.log(err); });

I tried the following values for path:

D:\\maps.mbtiles
D://maps.mbtiles
file:///D:\\maps.mbtiles
file://D:\\maps.mbtiles
\\\\D:\\maps.mbtiles
\\D:\\maps.mbtiles

The file exists (I can fs.stat() the file), I can even read it withfs.readFile(). Just node-mbtiles doesn't seem to get along with it.

I have consulted the source and it seems that on line 83 in mbiltes.js it uses uri.pathname to parse the input file, which does not include a drive letter.

Any ideas how to get it working?

EDIT:

How about using url.fileURLToPath(dbPath) instead of using uri.pathname?

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