ext2 plugin doesn't support files larger than 2G
Moderators: Hacker, petermad, Stefan2, white
ext2 plugin doesn't support files larger than 2G
ext2 plugin doesn't support files larger than 2G
any chance this will be fixed?
--sadyc
any chance this will be fixed?
--sadyc
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
In principle, the plugin interface can support it. The ext2 plugin is based on a tool called explore2fs, I don't know whether this tool supports files > 2 GB now.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
ext2fs is a file system plugin, which uses WIN32_FIND_DATA, so 64 bit numbers are no problem.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Not with the ext2 plugin, but my sample plugin which shows the local file system shows files >4 GB without any problems. The sample plugin is on
http://www.ghisler.com/plugins.htm#filesys
in the section "FS-Plugin writer's guide 1.3".
http://www.ghisler.com/plugins.htm#filesys
in the section "FS-Plugin writer's guide 1.3".
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Well.. things aren't that simple.ghisler(Author) wrote:ext2fs is a file system plugin, which uses WIN32_FIND_DATA, so 64 bit numbers are no problem.
I've tracked down why ext2fs plugin doesn't support files larger than 2/4G.
Here is how size is stored in an ext2 inode (from ext2fs plugin code):
Code: Select all
i_size : ULONG; // Size in bytes */
However, ext2 _does_ have files larger than 4G. How?
It uses a trick to store the higher 32 bits (from a 64bits integer) in the following field:
Code: Select all
i_dir_acl : ULONG; // Directory ACL */
Here is proof from Linux kernel 2.4 ext2 source:
Code: Select all
inode->i_size = le32_to_cpu(raw_inode->i_size);
Code: Select all
if (S_ISREG(inode->i_mode))
inode->i_size |= ((__u64)le32_to_cpu(raw_inode->i_size_high)) << 32;
Code: Select all
Size := info.i_size;
Code: Select all
Size : ULONG;
Written : ULONG;
It was not a file system restriction but a linux kernel internal restriction.
--adrian