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

Incorrect information in /documentation/files/files.md regarding changing the value of config.file.root #1386

Closed
kallistisoft opened this issue Aug 9, 2024 · 3 comments

Comments

@kallistisoft
Copy link

Build environment: All
Moddable SDK version: 4.9
Target device: Any

Description
The documentation for overriding the default config.file.root value is incorrect.
Currently in /documentation/files/files.md the section "Host File System Configuration" has this code fragment:

"defines": {
	"file":{
		"root": "#/myroot"
	}
}

The correct code fragment is:

"config": {
	"file":{
		"root": "/myroot"
	}
}

Errata
Submitting as an issue to avoid sending a two line PR :)

@kallistisoft
Copy link
Author

kallistisoft commented Aug 9, 2024

Additional question; in /modules/files/file/manifest.json

The default file root is /tmp/ for linux and wasm builds, whereas for windows its ./ and on macos it's /Users/Shared/

Is there a compelling rational for this discrepancy with linux?
Seems like it should also be ./ for consistency and principle of least surprise?

@phoddie
Copy link
Collaborator

phoddie commented Aug 9, 2024

@kallistisoft – thanks for the reports. I'll update the Files document to correct that. The convention is to have the root end with a / – so you can write config.file.root + "foo.json", so it will be /myroot/.

The file root for desktop computers is a little bit arbitrary and, admittedly, inconsistent. But, I'm not sure what would be least surprising; ;) The idea is to have the file system be in some sort of local sandbox, since that better reflects the file system on an embedded microcontroller.

mkellner pushed a commit that referenced this issue Aug 9, 2024
@phoddie
Copy link
Collaborator

phoddie commented Sep 14, 2024

Fixed.

@phoddie phoddie closed this as completed Sep 14, 2024
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

2 participants