summaryrefslogtreecommitdiff
path: root/cmd/filewriter
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-24 20:36:26 +0300
committerPaul Buetow <paul@buetow.org>2026-04-24 20:36:26 +0300
commit92a36a8c5f23756b8c6d721e89450752409ddd75 (patch)
tree52adee49828831feb0ca557e7df736726faedac3 /cmd/filewriter
parentfadbf135d0b251387fd785083df79e27d1025cac (diff)
task a8: move all binaries under ./cmd/<name>/main.go
Relocates the two non-canonical main packages so every binary in the repo lives at ./cmd/<BINARY>/main.go: - tools/filewriter/ -> cmd/filewriter/ - integrationtests/cmd/ioworkload/ (20 files) -> cmd/ioworkload/ Consumers updated: - Magefile.go: workloadSourcePath now ./cmd/ioworkload - integrationtests/README.md: structure note points at ../cmd/ioworkload Files moved with git mv so git log --follow history is preserved. cmd/ior/main.go was already canonical and is untouched. Verified: mage build produces the ior binary; go build ./cmd/... builds filewriter and ioworkload; go test ./cmd/ioworkload passes; go vet ./cmd/filewriter ./cmd/ioworkload is clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'cmd/filewriter')
-rw-r--r--cmd/filewriter/main.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/cmd/filewriter/main.go b/cmd/filewriter/main.go
new file mode 100644
index 0000000..25f5cb7
--- /dev/null
+++ b/cmd/filewriter/main.go
@@ -0,0 +1,35 @@
+package main
+
+import (
+ "os"
+ "time"
+)
+
+func main() {
+ // Open the file in append mode, create it if it doesn't exist
+ file, err := os.OpenFile("output.txt", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
+ if err != nil {
+ panic(err)
+ }
+ defer file.Close()
+
+ // Define the byte to be written
+ data := []byte("A") // Replace 'A' with any byte you wish to write
+
+ // Loop to write the byte every 3 seconds
+ for {
+ _, err := file.Write(data)
+ if err != nil {
+ panic(err)
+ }
+
+ // Flush writes to stable storage
+ err = file.Sync()
+ if err != nil {
+ panic(err)
+ }
+
+ // Wait for 3 seconds
+ time.Sleep(3 * time.Second)
+ }
+}