OPINION OF THE COURT
David Stadtmauer, J.This is a writ of habeas corpus brought by the inmate claiming that he is being held illegally due to failure of the People to file an information “for a period of more than five days” following the onset of custody. The relevant statute (CPL 170.70) provides that:
“Upon application of a defendant against whom a misdemeanor complaint is pending in a local criminal court, and who, either at the time of his arraignment thereon or subse*255quent thereto, has been committed to the custody of the sheriff pending disposition of the action, and who has been confined in such custody for a period of more than five days, not including Sunday, without any information having been filed in replacement of such misdemeanor complaint, the criminal court must release the defendant on his own recognizance unless:
“1. The defendant has waived prosecution by information and consented to be prosecuted upon the misdemeanor complaint, pursuant to subdivision three of section 170.65; or “2. The court is satisfied that there is good cause why such order of release should not be issued. Such good cause must consist of some compelling fact or circumstance which precluded replacement of the misdemeanor complaint by an information or a prosecutor’s information within the prescribed period.”
In this case, the defendant was arrested on Thursday, September 3, 1998, for public lewdness, and remained confined thereafter. Excluding the date of arrest (“the calendar day from which the reckoning is made” [General Construction Law § 20]) as well as the following Sunday (Sept. 6th), the five-day period for the filing of the requisite information concluded at midnight of Wednesday, September 9th. (See, General Construction Law §§ 19, 20; CPL 170.70.)
The People concede that the information was not filed until Thursday, September 10th (which falls after the five-day statutory period) but contend, as they did before the Judge in criminal court on September 10th, that the issue of custody became moot once the information was filed. That court agreed and refused to release the defendant pursuant to CPL 170.70. Neither statutory nor judicial authority was set forth to support that position. Hence, the matter is now before this court by way of writ of habeas corpus, which is the only effective procedural relief available to the defendant at this juncture. Resort to traditional appellate practice would, of course, render the legality of his pretrial detention moot (cf., People ex rel. Chakwin v Warden, 63 NY2d 120).
As noted in People v Hernandez (145 Misc 2d 491, 495), the purpose of CPL 170.70 “is to protect the defendant’s right to prosecution by information only and, more specifically, to guarantee that a defendant will not be deprived of his liberty beyond a reasonable, finite period if the prosecution has violated that right” (emphasis added). Thus, in this court’s view, the defendant is entitled to release, pursuant to CPL 170.70, at 12:01 a.m. of the “sixth” day, and the fact that he had been confined without legal authority past that time can*256not be cured nunc pro tunc by the subsequent filing of an information. If the opposite were true, there would be no point for any prosecutor to adhere to clearly defined statutory time requirements.
The statute does provide for certain exceptions to the rule regarding release on recognizance; however, none of these exceptions apply in this case. There is no showing in the record that the defendant waived prosecution by information and consented to be prosecuted upon the misdemeanor complaint; there is no showing of any consent by the defendant to any adjournment beyond the five-day period for the filing of the information; and there is no indication of “good cause” why an order of release should not have been issued.
The statute is unambiguous — and absent those circumstances which do not apply here — release is mandated (People ex rel. Chakwin v Warden, supra, at 125). Accordingly, the writ is sustained and the inmate is ordered released forthwith.