Jump to content

Listing files in a directory


NeXTreme

Recommended Posts

It would be really helpful if we had a function to retreive a list of all files in a resource's directory. We already have a bunch of functions for handling files. I was surprised there's no function that would list all the files, really.

An example use would be

  
files = {} 
  
files = fileList() -- list all files in the current resource's running directory 
  
files = fileList("/client") -- list all files in the current resource's subdirectory "client"  (ex. joinquit/client/) 
  
  

Edited by Guest
Link to comment

I remember I wrote a patch which had a function getResourceFiles (it was both, server and client side) but it was never committed. It's not hard to write that function and I'm surprised it hasn't been added yet.

Link to comment
  • 2 weeks later...

getResourceFiles sounds like it gets files that are included in the meta.xml only (which can also be accomplished via some XML scripting). The function should list all files in the directory of the resource it's runnning from. However, it must not list files from other resources, since that can be a security issue (like, reading autologin information from other servers).

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...