If the person to whom the writ is directed refuses, after service, to obey the same, the Court or Judge, upon affidavit, must issue an attachment against such person, directed to the Sheriff or Coroner, commanding him forthwith to apprehend such person and bring him immediately before such Court or Judge; and upon being so brought, he must be committed to the jail of the county until he makes due return to such writ, or is otherwise legally discharged.
Ca. Pen. Code § 1479