When the jail of any county is destroyed by fire or other accident, any judicial officer of such county may cause all prisoners then confined therein to be brought before him. Upon the production of the process under which any prisoner was confined, such judicial officer shall order his commitment to the jail of any adjacent county. The sheriff or other officer of the county deputized for that purpose shall obey the order; and the sheriff or keeper of the common jail of such adjacent county shall receive such prisoners consistent with those provisions of G.S. 162-38.
N.C. Gen. Stat. § 162-40