Matlab dir() takes forever to run

后端 未结 2 504
深忆病人
深忆病人 2021-01-20 16:58

I\'m using the command \"dir\" on a directory with 500,000 files. It\'s been running for 15 minutes now.

Is there any way to speed it up? an alternative command per

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-20 17:39

    If you just want file names, try files = ls;. As per the help, I believe ls should work on any OS. The reason dir takes so long in your case is that it's calculating the file size, modification date, etc. of each file.

提交回复
热议问题