In gnuplot for Windows, how can I list the files in the current/working directory?

gnuplot

Solution

A quick code review of Gnuplot 4.6.0 shows that `ls` (or similar) isn't supported in windows.

You can however use the `system` command, like `system 'dir'`

Problem

I am running `gnuplot` version 4.6 (patchlevel 0) for Windows. The Windows version of this program provides a console or command prompt interface, similar to a `bash` shell in Unix/Linux or the DOS Command Prompt in Windows. Some commands in `gnuplot` for Windows are similar to those in Unix/Linux or DOS. For example, `pwd` prints the current/working directory. Also, `cd` changes the directory, so I can use commands like `cd 'C:\Documents and Settings'`. However, I have oddly not been able to figure out how to list the files in the current/working directory (which in Unix/Linux would be `ls` and in DOS would be `dir`). Do you know how to do this?

Original source