mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
net/os: deprecate write_str() in favor of write_string()
This commit is contained in:
@@ -311,14 +311,9 @@ pub fn (mut f File) flush() {
|
||||
|
||||
// write_str writes the bytes of a string into a file,
|
||||
// *including* the terminating 0 byte.
|
||||
[deprecated: 'use File.write_string() instead']
|
||||
pub fn (mut f File) write_str(s string) ? {
|
||||
if !f.is_opened {
|
||||
return error('file is closed')
|
||||
}
|
||||
written := int(C.fwrite(voidptr(s.str), s.len, 1, f.cfile))
|
||||
if written == 0 && s.len != 0 {
|
||||
return error('0 bytes written')
|
||||
}
|
||||
f.write_string(s) or { return err }
|
||||
}
|
||||
|
||||
// read_struct reads a single struct of type `T`
|
||||
|
Reference in New Issue
Block a user