Harrison, J.
Application for a writ of mandate.
In the action of Emeric v. Alvarado, for the partition of the Rancho San Pablo, the above-named petitioner was one of the defendants claiming a portion of the *104land, and by the final decree was awarded one portion of the land claimed by her — another portion, designated as lot No. 198, being allotted to H. F. Emeric. This decree was entered March 3, 1894, and notice thereof served upon the petitioner upon the same day. By the terms of the decree it was ordered and adjudged “that the several parties to this action do forthwith surrender and deliver up the possession of such parcels of said rancho as they now respectively occupy, -which have not been allotted to them in severalty by said decree, and that in default thereof writs of possession shall, on the application of any of the parties thereto, be issued by the cleric of said court and under the seal thereof, directed to the sheriff of the county of Contra Costa, commanding him to place said parties in the quiet and peaceable possession of the said parcels allotted to them as aforesaid, and to remove all other persons therefrom.” At the date of the decree, and for several j’ears prior thereto, lot 198 was in the possession of W. B. Hellings and his tenants, claiming to hold the same under and as the successor in interest of Mrs. Gutierrez. After the entry of the decree an appeal therefrom was taken to this court on behalf of, and in the name of, Mrs. Gutierrez, and an application was made to the respondent to fix the amount of the undertaking against waste and for use and occupation, required by section 945 of the Code of Civil Procedure, for the purpose of staying proceedings on the judgment. This application was heard by the respondent March 23d, after notice thereof had been given to Emeric, and was by him denied. Thereupon the present application was made to this court for a writ of mandate directing the respondent to fix the amount of such undertaking. In his answer to the application the respondent alleges that on the fifth day of March an affidavit was filed in the superior court, showing that after entry of the decree demand had been made by Emeric upon Hellings and his tenants for the possession of lot 198, and that they had refused to give possession; that upon an ex parte application on said *105affidavit a writ of possession was issued by the clerk under the order of the court, directed to the sheriff, to place Emeric in the quiet and peaceable possession of lot 198, and to remove all other persons therefrom; that before any application had been made to fix the amount of the undertaking the said writ had been served and executed by the sheriff, and return thereafter made to the effect that he had placed said Emeric in actual possession of the premises, and removed all other persons therefrom. It is now claimed on behalf of the respondent that because of these facts he was not required to fix any amount for said undertaking.
We are of the opinion, however, that it was the duty of the respondent to fix an amount for which the appellant might give an undertaking to stay proceedings upon the judgment, if she so desired. Section 945 of the Code of Civil Procedure provides that all proceedings in the court below upon a judgment which directs the delivery of possession of real property maybe stayed if. the appellant executes a written undertaking to the effect that during the possession of such property by him he will not commit, or suffer to be committed, any waste thereon, and that, if the judgmént be affirmed, he will pay the value of the use and occupation of the property from the time of the appeal until the delivery of the possession thereof. This is a right conferred upon an appellant by the statute, and the same statute makes it the official duty of the judge to fix the amount of the undertaking that is to be given. If the judge refuse to fix the amount for such undertaking he thereby deprives an appellant of a substantial right - which the statute has conferred. The decree in the present case directs the delivery of possession of real property, and -was rendered by the respondent; and when he was informed of the desire of the petitioner to appeal therefrom, and to have proceedings thereon stayed pending the appeal, liis official duty to fix the amount of the undertaking was clear. If after the entry of the decree matters had supervened which might deprive the appel*106lant of an effective stay of proceedings, even though she should give the undertaking, the respondent should determine the sufficiency of those matters when presented upon a direct issue in which her right to the stay of proceedings was involved, rather than adjudicate upon their sufficiency before there was an opportunity for her to ask for such stay. Whether, after she had given such an undertaking, she could avail herself of the privileges which the statute confers would be a matter then to be considered and determined. If, in fact, the execution of the decree had become so complete that there were no proceedings thereon to be stayed, no harm could be done to any of the parties to the action by the giving of such an undertaking, and, if there should be any reason by which the appellant might show herself entitled to a stay, notwithstanding the execution of the decree, she ought to be allowed that privilege. The respondent should not deprive her of the opportunity which the statute affords in this respect by refusing to fix the amount of the undertaking.
The application for the writ is granted.
YaN Fleet, J., Fitzgerald, J., De Haven, J., Ga-routte, J., and Beatty, C. J., concurred.