This is an appeal from the denial of relief in the trial court after hearing on three petitions for writs of habeas corpus.
The petitions for writs of habeas corpus arose out of the defendant’s pretrial detention as a result of his arrest on charges of offering to sell marijuana, § 36-1002.07 A.R.S., as amended 1961, and sale of dangerous drugs (LSD), § 32-1964(A) (7) A.R.S., as amended 1967. In both the criminal charges and in his habeas corpus proceedings, defendant acted as his own attorney.
The defendant, in his three petitions to the Superior Court, contended that he was being held illegally because of excessive bond, and because the jailors of the Maricopa County Jail were preventing him from adequately representing himself by reading his files and seizing his papers, by denying him access to law books, and by placing him in the “Attitude Adjustment Center” otherwise known as the “hole.” *179The matter of bail was disposed of prior to hearing by the reduction of the amount of the bond from $55,000 to $5,500.
There were five days of testimony, most of which was presented by the defendant. The defendant was later tried and convicted of the charges on which he was being held. This court in State v. Yanich, 110 Ariz. 172, 516 P.2d 308, filed this day, held on the same facts raised in this appeal that the defendant was not denied his right to a fair and impartial trial by reason of his pretrial detention.
The criminal conviction having been affirmed, we have only one question to consider on appeal and that is: Did the trial court abuse its discretion in denying the relief requested by the defendant in his three consolidated petitions for writs of habeas corpus ?
We have stated:
“ * * * The issuance of a writ of habeas corpus generally is within the discretion of the trial court. * * * ” Boies v. Dovico, 97 Ariz. 306, 308, 400 P.2d 109, 110 (1965).
We have carefully reviewed the testimony produced at the five days of the hearing. The defendant produced seven witnesses including cell mates and sheriff’s deputies, and he testified himself. The State produced five witnesses. As might be expected, much of the testimony was contradictory. An extensive recital of the testimony is unnecessary at this time. Suffice it to say that the testimony amply supports the finding of the trial court made at the end of the testimony :
“THE COURT: Well, I think I should make a ruling in this matter promptly because of the trial setting in the criminal case before Judge Thompson. The petitioner, Mr. Yanich, is a defendant in a criminal case and is the petitioner in these habeas corpus proceedings and may represent himself if he chooses; and he has made it very clear that he desires to act as his own attorney. That’s his privilege. However, in these proceedings, he has had the benefit of counsel by the representation in court of a Public Defender who was appointed by this Court to be present and assist Mr. Yanich.
It appears to the Court that during the confinement of petitioner in the Maricopa County Jail, he has had numerous visits from lawyers representing him. It further appears from the evidence that the petitioner was furnished Xeroxed copies of cases although he did not have the bound volumes of the cases.
Now, the Court’s of the opinion that the defendant, while in custody of the sheriff, is not immune from routine jail procedures or reasonable searches as security measures. There’s been no showing from the evidence of any indication that the defendant has been unreasonably deprived or prejudiced in the matter of preparing his defense or petitions for writs of habeas corpus. So, under all the evidence developed in these proceedings, the Court finds the petitioner has not been deprived unreasonably of preparing his defense or any other legal matters, and the Court further finds the disciplinary and routine security measures employed by the sheriff were not harsh or oppressive and did not exceed reasonable limits.
So, the Court finds the defendant is not wrongfully detained and has not been prejudiced by the sheriff or any of his deputies; and it is, therefore, ordered denying the writs of — the petitioner’s three writs of habeas corpus. * * * ”
Decisions of the trial court on the three petitions affirmed.
HAYS, C. J., and STRUCKMEYER, LOCKWOOD and HOLOHAN, JJ., concur.