The magistrate or his or her clerk shall keep the depositions taken on the information or the examination, until they are returned to the proper court; and shall not permit them to be examined or copied by any person except a judge of a court having jurisdiction of the offense, or authorized to issue writs of habeas corpus, the Attorney General, district attorney, or other prosecuting attorney, and the defendant and his or her counsel; provided however, upon demand by the defendant or his or her attorney the magistrate shall order a transcript of the depositions taken on the information, or on the examination, to be immediately furnished the defendant or his or her attorney, after the commitment of the defendant as provided by Sections 876 and 877, and the reporter furnishing the depositions, shall receive compensation in accordance with Section 869.