about summary refs log tree commit diff stats
path: root/087file.cc
Commit message (Collapse)AuthorAgeFilesLines
* 3238Kartik K. Agaram2016-08-211-3/+14
| | | | | | 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.
* 3237Kartik K. Agaram2016-08-211-0/+36
| | | | | | | | 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.)
* 3236Kartik K. Agaram2016-08-211-5/+0
|
* 3225 - testable interface for writing filesKartik K. Agaram2016-08-181-2/+2
| | | | | | | | 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.
* 3195Kartik K. Agaram2016-08-161-0/+3
|
* 3185Kartik K. Agaram2016-08-141-1/+1
|
* 3184Kartik K. Agaram2016-08-141-0/+2
| | | | Fix CI. How does it work on my Mac without explicitly including errno?
* 3183 - cleanupKartik K. Agaram2016-08-131-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* 3182 - primitives for manipulating the file systemKartik K. Agaram2016-08-131-9/+160
| | | | | | | | | | | | | | 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.
* 2788Kartik K. Agaram2016-03-161-0/+27