getLastModified.lua 671 B

123456789101112131415161718192021222324252627
  1. return {
  2. tag = 'filesystem-files',
  3. summary = 'Get the modification time of a file.',
  4. description = 'Returns when a file was last modified, since some arbitrary time in the past.',
  5. arguments = {
  6. path = {
  7. type = 'string',
  8. description = 'The file to check.'
  9. }
  10. },
  11. returns = {
  12. time = {
  13. type = 'number | nil',
  14. description = 'The modification time of the file, in seconds, or `nil` if there was an error.'
  15. },
  16. error = {
  17. type = 'string | nil',
  18. description = 'The error message, if there was an error.'
  19. }
  20. },
  21. variants = {
  22. {
  23. arguments = { 'path' },
  24. returns = { 'time', 'error' }
  25. }
  26. }
  27. }