Skip to content

Commit

Permalink
Return bytesWritten instead of True on successfull file.write()
Browse files Browse the repository at this point in the history
Signed-off-by: Flipez <code@brauser.io>
  • Loading branch information
Flipez committed Jun 26, 2022
1 parent 6adb5f9 commit c1db6e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions object/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ func init() {
},
},
"write": ObjectMethod{
description: "Writes the given string to the file. Returns `true` on success.",
description: "Writes the given string to the file. Returns number of written bytes on success.",
returnPattern: [][]string{
[]string{BOOLEAN_OBJ, ERROR_OBJ},
[]string{INTEGER_OBJ, ERROR_OBJ},
},
argPattern: [][]string{
[]string{STRING_OBJ},
Expand All @@ -198,7 +198,7 @@ func init() {
return NewError(err)
}

return TRUE
return NewInteger(int64(bytesWritten))
},
},
}
Expand Down

0 comments on commit c1db6e2

Please sign in to comment.