The respondents have excepted to an order requiring them to permit the petitioner, a stockholder in the respondent corporation, to examine certain corporate records, accounts and documents. The bill of exceptions states that the case came on to be heard on the petition and answer, and that the judge entered an order which, after stating that "it was agreed” by the respondents that "the facts were as set forth in the petition,” ordered the respondents to allow an examination of four different classes of records, books and documents.
The petition for a writ of mandamus alleged that the petitioner was a stockholder in the respondent corporation; that he had made a demand for the examination of certain books and records; and that such demand had been refused. These allegations were admitted by the respondents’ answer, which further alleged that the petitioner had brought a bill in equity against the respondent corporation and others, the pleadings in which were made a part of the answer. The answer also alleged that the petition was brought in aid of the said bill in equity; that the petitioner had a plain and adequate remedy in the equity suit'to enforce his right of inspection of the corporate books and records; that the petition for a writ of mandamus was intended to oppress and harass the respondents and was unnecessary; and that the petitioner was barred by loches from maintaining the petition.
Proceedings upon a petition for a writ of mandamus are proceedings at law and not in equity, Mansfield v. Secretary of the Commonwealth, 228 Mass. 262, Coughlin v. Election Commission of Lowell, 294 Mass. 434, Amory v. Assessors of Boston, 309 Mass. 162; but where all that is submitted *423to the judge is the pleadings, the effect to be given to them in deciding an action at law is different from the effect to be given in equity, where the general rule is that facts well pleaded in the bill and not denied in the answer and facts alleged in the answer and at variance with those alleged in the bill are to be accepted as true. Polish Political Club v. Cloper, 260 Mass. 559. Karcher v. Burbank, 303 Mass. 303. Taylor v. Haverhill, 316 Mass. 380. A judge may order a judgment for the plaintiff if he believes the declaration sets forth a good cause of action and the defendant admits all the material facts alleged, leaving open the question of law whether upon the facts alleged and admitted the plaintiff is entitled to recover. See Pratt v. Langdon, 12 Allen, 544, 546; Goldstein v. D’Arcy, 201 Mass. 312. The judge did not consider as true the affirmative defences alleged in the answer. It may be that the parties were willing to submit the case only on what was alleged in the petition and that part of the answer which admitted such allegations. The truth of these affirmative allegations was to be taken as denied in the absence of any order requiring the filing of a replication if a respondent in mandamus insists upon them. G. L. (Ter. Ed.) c. 249, § 5, as amended by St. 1943, c. 374, § 2. Nester v. School Committee of Fall River, 318 Mass. 538. The judge, in view of the manner in which the case was submitted, was right in not considering such affirmative defences. In other words, the case was decided upon the petition and that part of the answer which admitted the allegations of fact contained in the petition. The same thought is expressed by the judge in the order wherein he stated that the respondents agreed that the facts were as alleged in the petition. But the respondents contend that the facts alleged and admitted do not entitle the petitioner to the writ because there is no proof that in bringing the petition he was actuated in good faith to accomplish a proper purpose. The admission of all facts alleged in the petition would not sustain a judgment for the petitioner if the facts alleged did not make out a case. Hemmenway v. Hickes, 4 Pick. 497. Dryden v. Dryden, 9 Pick. 546. Tarbell v. Gray, 4 Gray, 444. Hollis v. Richardson, 13 Gray, 392. *424Commonwealth v. Andler, 247 Mass. 580. See Mayor of Cambridge v. Dean, 300 Mass 174.
Our inquiry is whether on the facts alleged and admitted the petitioner was entitled to prevail. At the outset it must be observed that the petitioner is not seeking to enforce any statutory right of examination of the books and records specified in G. L. (Ter. Ed.) c. 155, § 22, and no such statutory right is involved in the present case. See Powelson v. Tennessee Eastern Electric Co. 220 Mass. 380; Shea v. Parker, 234 Mass. 592.
The common law right of a stockholder to examine the books and accounts of the corporation is not an absolute right but is a qualified one. Stockholders are the beneficial owners of all the assets of the corporation, and they are entitled to reliable information as to the financial condition of the corporation, the manner in which its business has been conducted and its affairs have been managed, and whether those to whom they have entrusted their property have acted faithfully and efficiently in the interests of the corporation. A stockholder who is acting in good faith for the purpose of advancing the interests of the corporation and protecting his own interest as a stockholder is generally entitled to examine the corporate records and accounts. But he has no such right to an examination if his purpose be to satisfy his curiosity, to annoy or harass the corporation, or to accomplish some object hostile to the corporation or detrimental to its interests. Varney v. Baker, 194 Mass. 239. Andrews v. Mines Corp. Ltd. 205 Mass. 121. Butler v. Martin, 220 Mass. 224. Electro-Formation, Inc. v. Ergon Research Laboratories, Inc. 284 Mass. 392. The burden of proof was upon the petitioner to allege and prove his good faith and a proper purpose. His right being a qualified one, he fails if his petition and proof are insufficient to bring his case within the limitations of this common law right. There was error in ordering the writ to issue, where, as here, all that appeared was that the petitioner was a stockholder and that his demand for an examination of certain books, records and documents had been denied. See State v. Middlesex Banking Co. 87 Conn. *425483, 484-485; State v. Pan American Co. 5 Pennewill (Del.) 391; Stone v. Kellogg, 165 Ill. 192, 204; Wilson v. Mackinaw State Bank, 217 Ill. App. 494, 500; Charles Hegewald Co. v. State, 196 Ind. 600, 606; People v. Walker, 9 Mich. 328, 330; Bruning v. Hoboken Printing & Publishing Co. 38 Vroom, 119, 120; Schroeck v. J. M. Quinby & Co. 102 N. J. L. 564, 566; Matter of Steinway, 159 N. Y. 250, 265; Matter of Latimer, 75 App. Div. (N. Y.) 522, 524; Matter of Hatt, 57 Misc. (N. Y.) 320; Davidson v. Almeda Mines Co. 66 Ore. 412, 416; Lyon v. American Screw Co. 16 R. I. 472; Dreyfuss & Son v. Benson, (Texas Civ. App.) 239 S. W. 347, 349; Rock Creek Oil Corp. v. Moore, (Texas Civ. App.) 41 S. W. (2d) 501, 504.
Exceptions sustained.