Skip to content

Commit

Permalink
Fix file.touch
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Nov 25, 2023
1 parent ba2efcc commit 892362c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ New:

Fixed:

- Fixed `file.touch` (#3529)
- Cleanup telnet commands on output shutdown,
prevent commands registration for internal
outputs (#3545, fixes: #3541)
Expand Down
14 changes: 7 additions & 7 deletions src/libs/file.liq
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ def file.write.stream(~perms=0o644, ~append=false, path) =
write
end

# Ensure that a file exists, creating it empty if it does not.
# @category File
# @param path Path of the file.
def file.touch(~perms=0o644, path) =
file.write(data="", perms=perms, append=true, path)
end

# Write data to a file.
# @category File
# @param ~data Data to write. If passing a callback `() -> string?`, the callback \
Expand All @@ -68,6 +61,13 @@ def replaces file.write(~data, ~perms=0o644, ~append=false, path) =
write()
end

# Ensure that a file exists, creating it empty if it does not.
# @category File
# @param path Path of the file.
def file.touch(~perms=0o644, path) =
file.write(data="", perms=perms, append=true, path)
end

# Read the whole contents of a file.
# @category File
def file.contents(fname) =
Expand Down

0 comments on commit 892362c

Please sign in to comment.