In a proceeding for relief inter alia under article 78 of the'CPLR, the appeal is from a judgment of the Supreme Court, Westchester County, entered January 5, 1971, which treated the proceeding as one in habeas corpus, discharged petitioner and exonerated the bail which had been set by a Committing Magistrate after a preliminary examination. Judgment reversed, on the law, without costs; petition dismissed; and petitioner directed to be admitted to bail in the amount heretofore fixed. In our opinion, Special Term erred in giving petitioner habeas corpus relief while he was at liberty on bail. A person released on bail is not restrained to such a degree as to entitle him to the extraordinary writ of habeas corpus (People ex rel. Schlanger v. Phimister, 35 A D 2d 1003; see, also, People ex rel. Wilder v. Markley, 26 N Y 2d 648). Furthermore, we do not feel that petitioner was entitled to relief had his petition been treated as seeking relief in the nature of mandamus. While mandamus is available in a criminal case where it is sought to compel a public officer to perform an act which he is required to do, such discretionary relief is extraordinary indeed and courts are loath to award such relief, unless a clear case of arbitrary and illegal action, without reasonable explanation or excuse, is presented; and that relief is invariably confined to compelling performance of a clerical or ministerial act (Matter of Bloeth v. Marks, 20 A D 2d 372; Matter of Keen v. Mirabile, 48 Misc 2d 382; Matter of General Steel Prods. Corp. v. City of New York, 18 Misc 2d 106). Despite the foregoing, we feel it important to state that with respect to the question of the right of a defendant to inspect and use prior statements of a preliminary examination witness, we are in accord with the portion of the opinion of the learned Justice at Special Term which deals with that subject. Applying the rationale of People v. Rosario (9 N Y 2d 286), absent the necessities of effective law enforcement which might require that the statement be kept secret or confidential, the State has no interest in interposing any obstacle to the disclosure of a prior statement by a preliminary examination witness which may expose the prosecution’s case and persuade the committing magistrate to refuse to bind the accused over (see Coleman v. Alabama, 399 U. S. 1; People v. Malinsky, 15 N Y 2d 86). Munder, Acting P. J., Martuscello, Latham, Shapiro and Gulotta, JJ., concur. [65 Misc 2d 536.]