getDirectoryItems.lua 710 B

123456789101112131415161718192021222324252627
  1. return {
  2. tag = 'filesystem-files',
  3. summary = 'Get a list of files in a directory.',
  4. description = 'Returns a sorted table containing all files and folders in a single directory.',
  5. arguments = {
  6. path = {
  7. type = 'string',
  8. description = 'The directory.'
  9. }
  10. },
  11. returns = {
  12. table = {
  13. type = 'items',
  14. description = 'A table with a string for each file and subfolder in the directory.'
  15. }
  16. },
  17. variants = {
  18. {
  19. arguments = { 'path' },
  20. returns = { 'table' }
  21. }
  22. },
  23. notes = [[
  24. This function calls `table.sort` to sort the results, so if `table.sort` is not available in the
  25. global scope the results are not guaranteed to be sorted.
  26. ]]
  27. }