I have one folder "test" which contains only one sparse file. The logical size of file is 5.24 GB but physical size is zero bytes, which is correctly displayed in file properties, but the physical size of parent folder is not zero bytes.
I want to know why there is difference in physical size of file and parent folder and is there any way to modify folder's physical size. Although du -sh returns correct physical size but I want to display it in info too, similar to the way it is displayed for sparse file.
I am using High Sierra with APFS. Check the property "Size" of file and folder in below image.
Asked
Active
Viewed 228 times
0

Digvijaysinh Gohil
- 1,367
- 2
- 15
- 30

Ankita Shrivastava
- 75
- 8
-
1What makes your topic a programming question? – El Tomato Dec 18 '17 at 11:34
-
@ElTomato basically my Application creates symbolic links of files at one's local computer and the actual files are at cloud. So I am able to create zero bytes files locally which displays the properties of files at cloud including there physical size for display. what I want to do is to modify the meta data of folder to show the correct size on disk. Somthing similar to smart sync feature of dropbox. – Ankita Shrivastava Dec 18 '17 at 12:11
-
_"I want to know why there is difference in physical size of file and parent folder and ..."_ A directory is nothing but a list of file names with their corresponding inodes `(file_name, inode_no)`. Then your directory contains a (file_name, inode) entry, so it's not empty. – GIZ Feb 06 '18 at 13:32