Description
Need file system operations in the standard library.
Suggested Functions
readFile(path) - Read file contents as string
writeFile(path, content) - Write string to file
appendFile(path, content) - Append to file
fileExists(path) - Check if file exists
deleteFile(path) - Delete a file
listDir(path) - List directory contents
Considerations
- Return
Result types for error handling: readFile("foo.txt")?
- Security: sandboxing? path validation?
Where to Start
pkg/eval/builtins.go - Add builtin implementations
- Use Go's
os and io/ioutil packages
Priority
High - needed for package manager and self-hosting.
Description
Need file system operations in the standard library.
Suggested Functions
readFile(path)- Read file contents as stringwriteFile(path, content)- Write string to fileappendFile(path, content)- Append to filefileExists(path)- Check if file existsdeleteFile(path)- Delete a filelistDir(path)- List directory contentsConsiderations
Resulttypes for error handling:readFile("foo.txt")?Where to Start
pkg/eval/builtins.go- Add builtin implementationsosandio/ioutilpackagesPriority
High - needed for package manager and self-hosting.