BASKIN, C. J.
An information in the case of the State of Utah v. Arthur Brown having been filed in the third District court of Salt Lake-county by the district attorney, charging the defendant, Arthur Brown, with, the crime of adultery, he afterwards appeared and moved the court to quash the information. The motion having been denied, the defendant entered a plea to the jurisdiction of the court, which having been overruled, the defendant on the 8th day of February, 1904, applied to this court for an alternative writ of prohibition, requiring Charles W. Morse, the presiding judge of the criminal division of said court, to show cause why said court should not be restrained from further proceeding in said case upon said information. It is alleged in the petition and affidavit of the petitioner “that the facts upon which said application is made are these: That the said procedure was begun by a complaint signed and sworn to before W. L. Emery, deputy clerk, and thereafter a warrant was issued by Hon. C. B. Diehl, judge of the city court of Salt Lake City; that said complaint was never shown to said C. B. Diehl prior to the issuing of the warrant; that the complainant was never examined by him, and no witnesses whatever were examined by the said C. B. Diehl before the issuing of said warrant; that the provisions of section 4612 of the Revised Statutes of 1898 were never complied with, in this, to-wit: that the said magistrate, C. B. Diehl, did not examine the said complainant under oath, or any other person, or take any deposition, but, as a matter of fact, the complainant in said cause, one A. H. Steele, a deputy sheriff had no knowledge whatever of the commission of said offense, of his own knowledge, and only heard of it; that the complaint was used merely as a formality, shown to the clerk, never examined by the magistrate, C. B. Diehl, and therefore this deponent alleges and claims that the issuing of the warrant was without authority, and the subsequent proceedings were without *338jurisdiction; that, upon the filing of the complaint in said city court, a warrant was prepared by said clerk and signed by the said judge, and thereafter the said defendant was arrested on the said warrant, and held to answer to a preliminary examination; that, upon the said preliminary examination, it developed that the said complainant, A. H. Steele, had no knowledge of his own as to the commission of the offense. Thereupon the said magistrate, Hon. C. B. Diehl, required the said defendant and affiant to appear in the district court to answer to an information therein to be filed, and thereafter the information heretofore mentioned was filed.”
The foregoing alleged facts were among those upon which the motion to quash and the plea to the jurisdiction were based. Neither the form nor substance of the complaint, the warrant of arrest, the commitment, or the information is questioned; the only objection being that the preliminary steps mentioned in sections 4612, 4615, Rev. St. 1898, were not taken. Before the motion and plea were overruled, several witnesses in behalf of the defendant were examined as to the preliminary steps taken. The district court had jurisdiction of the subject-matter of the information and therefore was authorized to decide whether the steps taken, as shown by the testimony of the witnesses examined, were sufficient to sustain the information, and also to decide the question of jurisdiction incidentally raised by the defendant. In passing upon the motion to quash and the plea to the jurisdiction, the district court did not exceed its jurisdiction, but acted within the scope of its authority, and, if it erred (which is a matter not now before us for consideration), the defendant’s remedy is by appeal, and not by the writ of prohibition. This view is sustained by the authorities upon the subject. In the case of Murphy v. Superior Court, 58 Cal. 520, which arose under section 811 of the Penal Code of that State, the provisions of which are substantially the same as section 4612 of the Revised Statutes of Utah of 1898, the court *339rendered the following opinion, to-wit: “This is an application for a writ of prohibition to stop the trial of a case now pending in the Superior Court within and for the county of Colusa. The application sets forth that the petitioner is being prosecuted by information in said court for the crime of an assault with intent to commit murder, and that the magistrate before whom the preliminary examination took place ‘did not examine, on oath or otherwise, the informer or prosecutor, and did not examine on oath or otherwise, any witness or witnesses, and did not take any deposition or depositions of any witness or witnesses, and no depositions of the informer or prosecutor, or any witness or witnesses produced 'by the informer or any other person, was or were taken or subscribed at all or at said time. ’ Conceding the above facts, the omissions complained of did not affect the question of jurisdiction, and therefore prohibition is not the proper remedy.” The same court, in Spect v. Superior Court, 59 Cal. 319, said: The writ [of prohibition] is dismissed in this case on the authority of Murphy v. Superior Court of Colusa County, 58 Cal. 520.” In Strouse v. Police Court, 85 Cal. 49, 24 Pac. 747, the court held that “where the petitioner was arrested under a warrant issued on a complaint filed in the police court, and charged with a misdemeanor, in having carried on business without a license, and pleaded, ‘not guilty,’ and also filed a plea to the jurisdiction of the court, a writ of prohibition will not be issued to restrain the court from proceeding with the trial of the action, as the petitioner has a plain, speedy and adequate remedy at law, by appeal to the superior court, if he should be convicted.” In Mines D’Or, etc., Soc. v. Superior Court, 91 Cal. 101, 27 Pac. 532, the court said: “We do not deem it either necessary or proper to determine at this time whether the action now pending against petitioners in the superior court is one in which the summons can be legally served by publication. That court has jurisdiction of the subject-*340matter of the action, and whether it has obtained jurisdiction over the persons of petitioners is a question which it must determine for itself before entering judgment in the action, and which it has the same authority to pass upon as any other question of law or fact which may arise during its progress; and if, in the decision, error shall he committed, to the prejudice of petitioners, the law affords them a plain, speedy and adequate remedy by an appeal from any judgment which may be entered against them. Agassiz v. Superior Court, 90 Cal. 101, 27 Pac. 49, and cases cited.” In Agassiz v. Superior Court, 90 Cal. 101, 27 Pac. 49, the court held that the fact that the question of jurisdiction is incidentally raised in an action does not present a sufficient cause for granting a writ of prohibition. Jacobs v. Superior Court, 133 Cal. 364, 65 Pac. 826, 85 Am. St. Rep. 204, is to the same effect. In the case of Murphy v. Superior Court, 84 Cal. 592-596, it is said in the opinion that “it is contended by the petitioner that the respondent has no jurisdiction to appoint him guardian of these minors on his own petition therefor, on the ground that a guardian can not be appointed by the court where one has already been appointed by deed. The Code provides that the superior court may appoint guardians of minors ‘who have no guardian legally appointed by will or deed. ’ Code Civ. Prac., sec. 1747; Civ. Code, sec. 243. And provision is made for the appointment of a guardian by deed of the parents of minor children. Civ. Code, sec. 241. But the superior court has general jurisdiction of the matter of appointment of guardians, and, as an incident to this jurisdiction, it must have the power to hear and determine the fact whether a testamentary guardian has been legally appointed, or not. If so, its jurisdiction can not be attacked in this collateral way. If, upon a direct appeal it appeared that a testamentary guardian had theretofore been legally appointed, the order granting letters would, no doubt, be reversed, but not on the ground that *341the court had no jurisdiction of the subject-matter.” In Wreden v. Superior Court, 55 Cal. 504, it is held that the writ of prohibition will not lie to restrain the superior court from passing upon a motion to dismiss an information, and in the opinion it is said: “As the court has jurisdiction of the subject-matter of the action and of the person of the defendant, it can, in the exercise of its jurisdiction, hear and determine any motion which may be made therein, and for that purpose may refer to and consider any papers on file in the case, or offered on the hearing of the motion, and do any and all things necessary and proper to a complete exercise of its jurisdiction.” In Powelson v. Lockwood, 82 Cal. 613, 23 Pac. 143, the court held: “A writ of prohibition is not allowable to prevent a justice’s court from trying a charge of vagrancy, under section 647 of the Penal Code without a jury. The justice’s court has jurisdiction of the subject-matter, and any error as to its mode of procedure can not be arrested or corrected by the writ of prohibition; the defendant having a plain, speedy and adequate remedy by appeal to the superior court.” “Where the inferior court has jurisdiction of the matter in controversy, prohibition will not lie. The writ does not lie to prevent a subordinate court from deciding erroneously or from enforcing an erroneous judgment in a case in which it has a right to adjudicate, and it matters not whether the court below has decided correctly or erroneously. Its jurisdiction of the matter in controversy being conceded, prohibition will not lie to prevent an erroneous exercise of that jurisdiction. The exercise of power which it is sought to prohibit must be wholly unauthorized by law.” 23 Am. & Eng. Ency. Law, pp. 200, 201, 202. “It is usually held that a prohibition is not a writ of right, but that its allowance rests in the sound discretion of the court. In some jurisdictions the rule is that the granting of the writ is obligatory in clear cases, where there is an entire absence of jurisdiction; the courts holding that it is dis*342cretionary only where there is another legal remedy or where the jurisdiction is doubtful or depends upon facts not apparent of record, or where the application is made by a stranger instead of a party in interest. 23 Am. & Eng. Ency. Law, p. 212, and cases cited in notes.
It is ordered that the application for the writ of prohibition be denied, and that the applicant pay the costs.
BARTCH and McCARTY, JJ., concur.