View/Edit #1:fileappend

Switch to edit mode.

Name(s): fileappend
1:  {file, data} = args
2:  if (!$perm_utils:controls(caller_perms(), this))
3:    raise(E_PERM)
4:  elseif (this.owner:free_dbytes() <= 0 && !caller_perms().wizard)
5:    raise(E_QUOTA, "Disk quota exhasted.")
6:  elseif (file in this.files_unwritable_by_owner && !caller_perms().wizard)
7:    raise(E_PERM, "File is not writable by the owner.")
8:  endif
9:  filename = $file_utils:trans_to($string_utils:lowercase(file))
10: fh = file_open($file_utils:filespec(this, file), "a-tf")
11: try
12:   for x in ({@data})
13:     file_writeline(fh, tostr(x))
14:     $command_utils:suspend_if_needed()
15:   endfor
16: finally
17:   file_close(fh)
18: endtry
19: this.obj_disk_size = this.obj_disk_size + value_bytes(data)
20: "This verb previously owned by manta (#7165), and chowned to $slacker upon dewizarding (Sat Aug 17 14:50:04 2002 MDT)."
21: "Last modified by Dax (#789) on Sat Aug 17 14:50:04 2002 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]