Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
V-FEXrt committed Sep 6, 2024
1 parent 9e119f5 commit bc8ae2a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions share/wake/lib/system/io.wake
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,19 @@ def writeRunner (content: String) =
# Insert the <write> job into the database
def _ = primJobVirtual job "" "" predict

# Wait for the virtual job to complete
require Pass reality = job.getJobReality

# Actually trigger the effects required by the job
require Some mode = int smode
else failWithError "write {path}: Unable to convert mode to Integer ({smode})"

require True = mode >= 0 && mode <= 0x1ff
else failWithError "write {path}: Invalid mode ({strOctal mode})"

match (primWrite mode path content)
def writeTask = primWrite mode path content

# Wait for the virtual job to complete
require Pass reality = job.getJobReality

match writeTask
Fail f -> failWithError f
Pass path ->
RunnerOutput (vis | map getPathName) (path,) reality
Expand Down Expand Up @@ -283,17 +285,19 @@ def mkdirRunner: Runner =
# Insert the <mkdir> job into the database
def _ = primJobVirtual job "" "" predict

# Wait for the virtual job to complete
require Pass reality = job.getJobReality

# Actually trigger the effects required by the job
require Some mode = int smode
else failWithError "write {path}: Unable to convert mode to Integer ({smode})"

require True = mode >= 0 && mode <= 0x1ff
else failWithError "mkdir {path}: Invalid mode ({smode})"

match (primMkdir mode path)
def mkdirTask = primMkdir mode path

# Wait for the virtual job to complete
require Pass reality = job.getJobReality

match mkdirTask
Fail f -> failWithError f
Pass path ->
RunnerOutput (vis | map getPathName) (path,) reality
Expand Down

0 comments on commit bc8ae2a

Please sign in to comment.