| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Clean up primitive for reading from file. Never return EOF character.
Stop using null character to indicate EOF as well. Instead, always use a
second product to indicate EOF, and require calls to use it.
|
|
|
|
|
|
|
|
| |
More checks for unsafe filesystem primitives. Most important, make sure
the product of any $close-file instruction is never ignored, and that
it's the same variable as the ingredient. (No way to indicate that in Mu
code yet, but then Mu code should always be safe and not require such
checks.)
|
| |
|
|
|
|
|
|
|
|
| |
For example usage of file operations, see filesystem.mu.
Is it ugly that we don't actually write to disk unless we wait for the
writing routine to exit? Maybe there's a nice way to wrap it. At any
rate, all buffering is explicit, which seems a win compared to *nix.
|
| |
|
| |
|
|
|
|
| |
Fix CI. How does it work on my Mac without explicitly including errno?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- New plan
Primitives:
$open-file-for-reading
$open-file-for-writing
$read-from-file
$write-to-file
$close-file
The '$' prefix indicates that none of these are intended to be used
directly since they rely on type-system-busting numbers. Also that they
are just temporary hacks depending on primitives provided by the host
system. A putative 'Mu machine' would have very different primitives.
Testable interfaces:
- start-reading: starts a routine to read from a file and returns the
source where the contents will become available.
- start-writing: starts a routine to write to a file and returns the
sink where the contents can be provided.
Both operate on the real file-system if the first 'filesystem'
ingredient is 0.
Once you start them up you can read/write/close the channel as usual.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I don't know why this took so long to gel. I just needed to copy my
approach to screen management:
1. primitives layer (C++): simple, non-testable, non-safe operations.
2. wrappers layer (Mu): wrap operations with dependency-injected
versions that can take a fake file system.
3. scenario layer (C++): implement assume-filesystem that constructs a
fake file system.
4. scenario test layer (Mu): test out assume-filesystem in a test.
This commit implements step 1.
|
|
|