Petition for mandate to compel the superior court to proceed with a hearing on contempt. The petition shows that an action was commenced in November, 1913, by a corporation, against the plaintiff, wherein damages were claimed in the sum of one million six hundred thousand dollars; that thereafter a second amended complaint was filed and petitioner made his verified answer thereto, and September 22, 1914, was set as the day for the trial of the issues thus made up; that on the day immediately preceding the day set for trial the plaintiff in that action filed with the clerk a direction that the suit be dismissed, and the clerk made an entry in the register of actions, noting that the action was dismissed and the order filed; that within five days thereafter petitioner, as the defendant in that action, filed his memorandum of costs, which amounted to sixty-nine dollars, and the court thereafter gave judgment in his favor for the amount of said costs. Execution for the collection of the amount of this judgment having been returned unsatisfied, the petitioner had proceedings instituted to have the matter of the ability of the corporation to pay investigated and for that purpose obtained an order for the examination of the president and secretary thereof; that these persons appeared before the court and gave testimony and thereupon the court made an order requiring said persons, as president and secretary of the judgment debtor corporation, to permit petitioner or his attorney or agent to examine the corporate books and records; that the president and secretary refused to comply with this order and thereupon a citation was secured requiring them to appear in court and show cause why they should not be held answerable as for a contempt; that upon the latter hearing being had, objection was made on the part of the corporation debtor that the judgment of the court was void upon its face in that there was no authority in the court after dismissal made by the clerk to enter any judgment for costs; that this contention was sustained and the contempt proceedings dismissed. By the writ here sought petitioner asks that the superior court be required to proceed *Page 795 and consider the charge of contempt against the president and secretary of the corporation mentioned.
A demurrer was interposed to the petition and the matter has been submitted upon the issue of law thus raised. The sole question involved is as to whether, where plaintiff in an action exercises his right to dismiss, in those cases where the code provides that he may do so by filing a request with the clerk, the opposite party is entitled to recover the costs that he may have incurred. Section 581 of the Code of Civil Procedure, provides that an action may be dismissed: "1. By the plaintiff himself, by written request to the clerk, filed with the papers in the case, at any time before the trial, upon payment of his costs; provided, a counterclaim has not been set up, or affirmative relief sought by the cross-complaint or answer of the defendant. . . ." Section 1024 of the same code gives to a defendant the right to collect costs incurred by him, as of course, "upon a judgment in his favor," in certain classes of actions of which that here involved was one. It has been held that the costs referred to in section 581 as being required to be paid by the plaintiff when he files his dismissal with the clerk, are only the costs of entering the order of dismissal. (Kaufman v. Superior Court, 115 Cal. 152, [46 P. 904]; Todhunter v. Klemmer, 134 Cal. 60, [66 P. 75].) This provision of the section so construed, respondent insists, furnishes the whole measure of its liability upon the dismissal of the action. On the other hand, the petitioner asserts that a dismissal so made does not interfere at all with his right to have a judgment following it entered, as he did, which would secure to him the expenses incurred in the action and which were in their nature proper costs. We are in complete accord with this contention and think that it proposes but a fair and reasonable construction for the statute. The dismissal as entered by the clerk upon the application of a plaintiff in such cases determines that action in favor of the opposite party; that suit is then forever ended. While the matter of the recovery of costs is one which rests wholly upon the authority of the statutes, it cannot be contemplated that the legislature, having provided authority and means for the securing of costs to litigants, intended to leave a defendant remediless against a plaintiff who chose to bring an action and put a defendant to great costs in preparing to meet the same and then dismiss the suit. This case is a typical *Page 796 illustration of the hardship which might result. Here the plaintiff filed several complaints, defendant made his verified answer, and proceedings were had to set the case for trial. Then, on the day before the trial was to take place, plaintiff appeared at the clerk's office and dismissed its action. The defendant presumably prepared himself for the trial and subpoenaed his witnesses on the assumption that the plaintiff would proceed at the time regularly set. A construction of the statute which will allow the recovery of costs in such cases is one that will appeal to the sense of fairness and justice of everyone and is the one which we will assume the legislature intended should be given to its declarations upon that subject. While the language may be taken as dictum, our supreme court in the case of Hopkins v. Superior Court, 136 Cal. 552, [69 P. 299], has given an intimation in favor of a defendant's right to recover costs in this kind of a case. It is there said that the clerk in entering a dismissal cannot settle a cost-bill, and this language follows: "The utmost of a defendant's right under the circumstances is to present his cost-bill in due time after dismissal to have it settled, and take judgment for his costs against plaintiff accordingly."
We are of the opinion that the writ should issue.
Peremptory writ of mandate is ordered to be issued in accordance with the prayer of the petition.
Conrey, P. J., and Shaw, J., concurred.