When indictment is waived in a superior court the district attorney shall file a superior court information in such court at the time the waiver is executed. When indictment is waived in a local criminal court the district attorney shall file a superior court information in the appropriate superior court within ten days of the execution of the court order approving the waiver. Upon application of a defendant whose waiver of indictment has been approved by the court, and who, at the time of such approval or subsequent 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 ten days from the date of approval without the filing by the district attorney of a superior court information, the superior court must release him on his own recognizance unless:
N.Y. Crim. Proc. Law § 195.40