필터 지우기
필터 지우기

Is there any way to speed up fclose when writing many small files?

조회 수: 8 (최근 30일)
Lawrence Karr
Lawrence Karr 2022년 3월 22일
댓글: Lawrence Karr 2022년 8월 20일
I need to write a very large number of distinct individual files to an SSD. Opening and writing these files is quick, but fclose is painfully slow.
Is there a way to speed this process? I am using a 2TB external drive.

답변 (1개)

Benjamin Thompson
Benjamin Thompson 2022년 3월 22일
Maybe push all the closing to the end and use fclose('all')? Is it possible there is still a write operation being completed and that is holding things up?
  댓글 수: 2
Lawrence Karr
Lawrence Karr 2022년 3월 22일
If I delay using fclose, and then fclose all, fclose all can take many seonds!
I checked and I can open and write many files (maybe 1000 of them) very quickly. If I then exit matlab, the files are present and correct. Eventually, if I don't do fclose, matlab complains. fclose takes something like 40 milliseconds (an eternity).
Lawrence Karr
Lawrence Karr 2022년 8월 20일
i had aleady tried the fclose all approach. i does not speed the process.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by