Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 17477

Real size of directory with subdirectories and files on disk

$
0
0

I need to create img container for archive some directories and files.

For that I need to create it with dd. It's no problem but I can't create it 'cause I don't know real size of the some directories and files. As I understand img container don't support dynamic size.

As we can see at image of link are two positions Size and Size on disk.As I understand I need Size on disk, but there is no Python example with Size on disk.

If I will use Size, maybe I will get an error Not enough space when use container.

Of course I can get real Size on disk with helping Block size of my partition and Size and calculate Size on disk by hand (like here) but I think it may be easier.

Q: How do get real Size on disk with Python?


Viewing all articles
Browse latest Browse all 17477

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>