Page 1 of 1
How to unmount the default source directory or .love file
Posted: Thu Feb 27, 2025 8:42 am
by ivan
Is it possible to unmount the default source directory or .love file?
I am facing an issue where lfs.getDirectoryItems returns items from both the default source directory and a newly mounted archive.
Re: How to unmount the default source directory or .love file
Posted: Thu Feb 27, 2025 10:08 am
by zorg
What mountpoint did you mount the newly mounted archive into? If you didn't supply one, it put the files into the root of the virtual file system, which is probably not the best of ideas.
Give the method a second parameter e.g. "mounts/"..tostring(id)" or whatever, and then you can freely iterate over that.
Alternatively, i believe you can also test what a file/folder's real path is, and if it's not what you want, you can ignore that during iteration. (example on the wiki)
Note that i'm making an assumption that this is not about "updating" your project from an archive, because if it is, mounting the files into the root and setting the third parameter to prepend instead of append the new files will work better.
Re: How to unmount the default source directory or .love file
Posted: Thu Feb 27, 2025 11:41 am
by ivan
Hey Zorg, good to see you again!
zorg wrote: ↑Thu Feb 27, 2025 10:08 am
What mountpoint did you mount the newly mounted archive into? If you didn't supply one, it put the files into the root of the virtual file system, which is probably not the best of ideas.
I am not using a mount point. I would like to overwrite the default source directory with another .love file.
zorg wrote: ↑Thu Feb 27, 2025 10:08 ammounting the files into the root and setting the third parameter to prepend instead of append the new files will work better.
I will try your suggestion although I am not 100% sure if it is what I need.