Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there a function available that will return a directory listing as an array of strings?

0
Posted

Is there a function available that will return a directory listing as an array of strings?

0

There’s a non-portable kludge: $ls >tmpfile and read the tmpfile. I’ve worked around the problem in the past by simply testing for the existence of files using open; as long as you can generate the name of a file which might be present (e.g.- a member of a family of files), that works pretty well, and is portable. The only thing you can’t do that way is to generate some sort of a menu of possible choices — but Yorick can’t do that very well anyway, so I haven’t been dying to fix the problem.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123