append.lua 857 B

123456789101112131415161718192021222324252627282930313233343536
  1. return {
  2. tag = 'filesystem-files',
  3. summary = 'Append content to the end of a file.',
  4. description = 'Appends content to the end of a file.',
  5. arguments = {
  6. filename = {
  7. type = 'string',
  8. description = 'The file to append to.'
  9. },
  10. content = {
  11. type = 'string',
  12. description = 'A string to write to the end of the file.'
  13. },
  14. blob = {
  15. type = 'Blob',
  16. description = 'A Blob containing data to append to the file.'
  17. }
  18. },
  19. returns = {
  20. bytes = {
  21. type = 'number',
  22. description = 'The number of bytes actually appended to the file.'
  23. }
  24. },
  25. variants = {
  26. {
  27. arguments = { 'filename', 'content' },
  28. returns = { 'bytes' }
  29. },
  30. {
  31. arguments = { 'filename', 'blob' },
  32. returns = { 'bytes' }
  33. }
  34. },
  35. notes = 'If the file does not exist, it is created.'
  36. }