
25 Cal.App.3d 1057 (1972)
102 Cal. Rptr. 378
SYSTEMS INVESTMENT CORPORATION, Plaintiff and Appellant,
v.
NATIONAL AUTOMOBILE AND CASUALTY INSURANCE COMPANY, Defendant and Respondent.
Docket No. 38770.
Court of Appeals of California, Second District, Division Four.
June 2, 1972.
*1058 COUNSEL
Allen, Fasman & Janger and Eugene J. Weiss for Plaintiff and Appellant.
Loeb & Loeb, William A. Halama and David Gould as Amici Curiae on behalf of Plaintiff and Appellant.
Brown & Brown, Howard B. Brown and Jared R.B. Hutton for Defendant and Respondent.
OPINION
KINGSLEY, J.
Plaintiff, Systems Investment Corporation (hereinafter sometimes referred to as "plaintiff" or "Systems") appeals from an order of dismissal, filed April 22, 1971, after sustaining a demurrer without leave to amend in favor of defendant, National Automobile and Casualty Insurance *1059 Company (hereinafter sometimes referred to as "defendant" or "National").
Although the complaint is not specific, we have taken judicial notice, pursuant to subdivision (d) of section 452 of the Evidence Code, of the superior court files in the two cases discussed below. From the complaint, the exhibit attached thereto, and the two superior court files, we glean the following:
Prior to May 19, 1965, Leon and Bertha Omansky were the owners of certain real property in the City of Los Angeles, on which they desired to construct an apartment building. Pursuant to that plan, they had procured a construction loan from the Union Bank of Los Angeles. By July of 1965, the interest of the Omanskys in the real property, and their rights under the loan agreement had vested in Systems. Hughes Steel Company (hereinafter "Hughes") had been given a contract for some or all of the construction work on the project. Thomas G. Gorzik, doing business as Western Construction, claimed that he had been given a subcontract by Hughes to perform work and provide material in connection with the project and that $15,953.79 was due and owing to him under that subcontract. On July 22, 1965, Gorzik recorded a mechanic's lien on the real property and, in purported compliance with subdivision (h) of section 1190.1 of the Code of Civil Procedure, as that section then read,[1] Gorzik served on Union Bank a verified stop notice and notice to withhold, accompanied by a bond executed by defendant National Automobile and Casualty Insurance Company. In spite of that procedure, Union Bank refused to honor the stop notice and paid out the funds in its hands either to plaintiff or on its directions.
Gorzik thereafter filed two actions in superior court. Action number 869,084 named as defendants: the Omanskys, Systems, Hughes, Union Bank, and 20 Does. Insofar as Systems was concerned, the action sought only to foreclose the mechanic's lien theretofore filed. At a later date, Gorzik filed a second action, number 913,128, naming as defendants: Union Bank, Systems, the Omanskys, and 20 Does. That action, in addition to claiming against the bank for disregard of the stop notice, also sought a personal judgment against all of the defendants. Action 869,084 went to trial, resulting in a judgment against Gorzik and in favor of all *1060 the defendants therein. Pursuant to a stipulation that the result in action 913,128 should be determined by the result in the other action, the trial court dismissed action 913,128.
Plaintiff then brought the present action, against the surety, seeking to recover the attorney fees and costs incurred in defense of the Gorzik actions. The trial court sustained a demurrer without leave to amend, on the express ground that neither court costs nor attorney fees are recoverable under the statute involved. Judgment of dismissal followed. We reverse the judgment.

I
Subdivision (h) of section 1190.1 of the Code of Civil Procedure read as follows: "Any of the persons mentioned in Sections 1181 and 1184.1, except the contractor at any time prior to the expiration of the period within which claims of lien must be filed for record, as prescribed by the provisions of Section 1193.1 of this code, may, in any instance in which the funds with which the cost of the work of improvements are, wholly or in part, to be defrayed from the proceeds of a building loan, give to the mortgagee, beneficiary under deed of trust, or assignee or successor in interest of either, or to any escrow holder or other party holding any funds furnished or to be furnished by the owner or lender or any other person as a fund from which to pay construction costs or arising out of a construction or building loan, a notice similar to the one provided for in subdivision (a) of this section, whereupon the person so given such notice under this subsection may withhold funds to answer such claims and any lien that may be filed therefor, but shall be under no obligation to do so unless a bond is furnished as hereinafter provided.
"If such person entitled to file such a claim under this subsection files with the person holding such funds as a fund from which to pay such construction costs, a bond with good and sufficient sureties in a penal sum equal to one and one-quarter times the amount of such claim, undertaking that if the defendant recovers judgment in an action brought on said verified claim or on the lien filed by the claimant, the lien claimant will pay all costs that may be awarded against the owner, contractor, or person holding such funds, or any of them, and all damages that such owner, contractor, or person holding such funds may sustain by reason of the equitable garnishment effected by the claim or by reason of the lien, not exceeding the sum specified in the undertaking, then the person holding such funds must withhold from the borrower or other *1061 person to whom said owner may be obligated to make payments or advancements out of said fund sufficient money to answer such claim, and any lien that may be filed therefor. No assignment by the owner or contractor of construction loan funds, whether made before a verified claim is filed, or after such claim is filed shall be held to take priority over claims filed under this subsection (h) and such assignment shall have no binding force insofar as the rights of claimants who file claims hereunder are concerned."
The bond executed by defendant followed the statutory language.
(1) Plaintiff contends that, although the statute does not expressly refer to attorney fees or to costs as recoverable under the bond, the procedure under section 1190.1 was analogous to the procedure in cases of attachment and in cases of injunction bonds and that it has been held that those bonds will permit recovery for attorney fees and costs where defense of the primary action is the only effective way to secure relief against the attachment or the injunction. Plaintiff relies on Reachi v. National Auto. & Cas. Co. (1951) 37 Cal.2d 808 [236 P.2d 151]; Stiner v. Travelers Indem. Co. (1964) 226 Cal. App.2d 128 [37 Cal. Rptr. 813]; Byard v. Nat. Auto. & Cas. Ins. Co. (1963) 218 Cal. App.2d 622 [32 Cal. Rptr. 613]; and on Russell v. United Pacific Ins. Co. (1963) 214 Cal. App.2d 78 [29 Cal. Rptr. 346].
Plaintiff's attempt to find an analogy between the attachment statute and the stop notice statute is persuasive. A stop notice has been regarded as an equitable garnishment (Diamond Match Co. v. Silberstein (1913) 165 Cal. 282 [131 P. 874]), and it has also been regarded as an attachment. (Davis v. Livingston (1865) 29 Cal. 283; Diamond Match Co. v. Silberstein, supra, at p. 288.) The court in Fredericksen v. Harney (1962) 199 Cal. App.2d 189 [18 Cal. Rptr. 562], stated that a stop notice given by one who has performed work or furnished materials on a public improvement is a garnishment (Code Civ. Proc., § 1190.1) and therefore is a form of attachment.
Since the stop notice statute has been held a type of attachment and since attorney fees are recoverable as damages under the attachment statute, and in view of the similarity of wording in both statutes, plaintiff's argument that attorney fees were damages under subdivision (h) of section 1190.1 of the Code of Civil Procedure is valid.

II
(2) Defendant argues that the cases relied on by plaintiff permit recovery of litigation expenses only where defense of the primary action *1062 was essential to afford relief from the attachment or injunction. (Stiner v. Travelers Indem. Co. (1964) supra, 226 Cal. App.2d 128; Russell v. United Pacific Ins. Co. (1963) supra, 214 Cal. App.2d 78, 88.) It is argued that, since the moneys were never withheld from plaintiff's control, nothing in the nature of an attachment  equitable or otherwise  ever resulted and, thus, that plaintiff was not required to defend either of the Gorzik suits in order to protect itself from the effect of the bonded stop notice.
While a reading of the superior court file in action 869,084, gives some support to that contention as to that action, since Gorzik could have sued to enforce his mechanic's lien whether or not he had filed a stop notice with the lender, we cannot, on that record, determine that defense of that action was not affected to some degree by the fact that the bank was joined as a party defendant and that the complaint pled the service of the bonded stop notice. Action number 913,128, was instituted by a complaint captioned "Complaint to Enforce Bonded Stop Notice, to Determine Priority, to Establish a Constructive Trust"; as we have said above, it sought, among other relief, a personal judgment against Systems. It is at least arguable that the allegations and prayer of that relief were so founded on the bonded stop notice that that notice had induced the action and, therefore, that defense of action 913,128 was essential to protect Systems' rights.
The action was dismissed below on the ground herein first discussed and found to be erroneous. Although the complaint might well have been more specific in its allegations as to the necessity of defending the two actions because of the bonded stop notice, we conclude that it was sufficient to raise that issue and to entitle plaintiff to go to trial.
The judgment (order of dismissal) is reversed with directions to overrule the demurrer and to give defendant a reasonable time to answer the complaint.
Files, P.J., and Jefferson, J., concurred.
A petition for a rehearing was denied June 21, 1972, and respondent's petition for a hearing by the Supreme Court was denied July 26, 1972.
NOTES
[1]  The events herein involved took place prior to January 1, 1971, on which date the statutes herein cited were replaced by section 3082 et seq. of the Civil Code. The references and quotations in this opinion are to the statutes as they read when the events herein involved occurred.
