Hi,
On Sat, 6 Jan 2007, jumpapex Shen wrote:
> 4. run "createf /mnt/ntfs/test 1", 'ls -l /mnt/ntfs/test' show its size is
> 1048576 bytes. It is correct, but command 'df' does not show that volume
> space has decreased with 1 mega bytes .
> 5. boot to windows xp. run 'fsutil file queryallocranges offset=0
> length=1048576 f:\test, it shows that only 64K space is allocated at the end
> of the file . But the file size still show 1mega bytes and volume does not
> show it decrease 1 mega bytes. It's the inconistence
This by design. This how Unix works. These files are called sparse files.
> The files created on reiserfs and fat32 volume with this program are all
> correct( the full size space are allocated for files), also it works
> correctly under windows xp for ntfs volume.
FAT32 has no sparse file support. So it works as expected.
The default Windows behaviour is also not to create sparse files. That must
be set explicitely programmatically. The behaviour is the opposite on
Linux. This also works as expected.
Reiserfs is known to have/had very bad performance with sparse files:
http://marc.theaimsgroup.com/?l=reiserfs&m=105781312812025&w=2
This can be explained if they allocate the blocks as you described. The
speed was improved a lot since then but apparently they still don't
implement the block allocation part semantics the unix way.
Please try the same with any other Linux filesystem (ext3, xfs, jfs) and
you should see what you experience with ntfs-3g.
If you want to do what you plan then the solution is
dd if=/dev/zero of=file ...
what you did was
dd if=/dev/zero of=file seek=...
Regards,
Szaka
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel