How can I find the size of all files located inside a folder?

后端 未结 12 2409
萌比男神i
萌比男神i 2020-12-06 05:49

Is there any API in c++ for getting the size of a specified folder?

If not, how can I get the total size of a folder including all subfolders and files?

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 06:14

    The file system functions are integral part of each operative system, written mostly in C and assembler, not C++, each C++ library implementation for this are in one way or another a wrapper of this functions. Taking on count the effort and if you will not use your implementation in different OS, maybe is a good idea to use this functions directly and save some overhead and time.

    Best regards.

提交回复
热议问题