Yeah I don't think we need to add specific sparse file handling to Ansible.

Ansible basically does a scp/sftp, so if those tools understand sparse
files, it may be a matter of passing a flag or something, and we'd be open
to patches for something like that I guess, if it were automatically
detectable or reasonably safe to pass.

On Sun, Oct 5, 2014 at 6:52 PM, Eric Wedaa <[email protected]>
wrote:

> I just found out that Ansible does not handle Sparse Files (A file with
> true empty space inside it) properly with the copy module.  I don't think
> this is a bug, but somebody should mention this in the documentation.
>
> http://en.wikipedia.org/wiki/Sparse_file
>
> Code to make a sparse file
>
> #!/usr/bin/perl
> ## Code Blatantly stolen from Elizabeth Zwicky
> #
> open (HOLEYFILE, ">filewithbighole") ||
>     warn "Can't create filewithbighole\n";
>
>     select (HOLEYFILE);
>     $| = 1;
>     select (STDOUT);
>
>     seek (HOLEYFILE, 1024* 1024 * 1024, 0);
>     print HOLEYFILE "After the hole\n";
>
>
> ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks)
> = stat HOLEYFILE;
>
>     if ($blocks * $blksize == $size) {
>         warn "My holey file had no holes!\n";
>     }
>
>     close HOLEYFILE;
>
>
> Ansible command
>
>
>
> ansible AIX-7.1 -m copy -a "src=/home/ME/filewithbighole 
> dest=/tmp/filewithbighole"
>
> It fails as running out of disk space.  It's not a big deal as there are 
> workarounds, like tar-ing up the file with the -S option to efficiently 
> handle Sparse files.
>
>
> [ME@ansible ~]$ ls -l filewithbighole
> -rw-r--r--. 1 urew users 1073741839 Oct  5 18:44 filewithbighole
>
> [ME@ansible ~]$ du -k filewithbighole
> 4     filewithbighole
>
> [ME@ansible ~]$ !tar
> tar -Scf filewithbighole.tar ./filewithbighole
>
> [ME@ansible ~]$ ls -lt filewithbighole.tar
> -rw-r--r--. 1 urew users 10240 Oct  5 18:48 filewithbighole.tar
>
> [ME@ansible ~]$ du -k filewithbighole.tar
> 12    filewithbighole.tar
>
>
> >>>>Ericw
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/5928585b-e458-4e0c-b9a4-fc056a3164f5%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/5928585b-e458-4e0c-b9a4-fc056a3164f5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyHDfrWCjRs_73wkeh9NpTdauGsasEinMDv44Zc5%2B8bGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to