Writs usually are considered to be extraordinary remedies, meaning they are permitted only when the defendant has no other adequate remedy, such as an appeal. In other words, a defendant may take a writ to contest a point that the defendant is not entitled to raise on appeal. As a general rule, this applies to issues that are not apparent in the record of the case itself (such as when an attorney fails to investigate a possible defense).
Any one of the following reasons, for example, may prohibit an appeal (and justify a writ):
The defense did not lodge a timely objection at the time of the alleged injustice (but should have).
A final judgment has not yet been entered in the trial court, but the party seeking the writ needs relief at once to prevent an injustice or unnecessary expense.
The matter is urgent. (Writs are heard more quickly than appeals, so defendants who feel wronged by actions of the trial judge may need to take a writ to obtain an early review by a higher court.)
The defendant has already lodged an unsuccessful appeal (defendants may file multiple writs but the right to appeal is limited to one). But filing a writ that simply mimics an unsuccessful appeal is a frivolous writ and will be dismissed immediately.