As per your statements, A is untouched. B is passed to another program. Is there any chance B has been modified?
Did you verify the permissions on B?
Because I can't think of any other scenario that would cause B to go empty. Note that A will still have non zero size (since it contains path of B).