Can the writ of habeas corpus be issue for directing the jail authorities to provide certain facilities?

In Sunil Batra v. Delhi Administration the Court held that “Where the rights of a prisoner either under the Constitution or under any other law are violated the writ power of the Court can and should run to his rescue”. In the present case, the judicial process was set in motion by a letter written by a prisoner to a Judge of the Supreme Court complaining of the brutal attack by the prison staff on a fellow prisoner. Forsaking all the procedural formalities, “since freedom was at stake”, the letter was treated by the Court as petition for the writ of habeas corpus.