The aim of the invention disclosed herein is to control and regulate the stiffness and flexibility of an endodontic file exploiting its super-elastic and shape-memory characteristics. This result is achievable thanks to temperature-induced phase transformations of the file performed by a proper heating and cooling system managed by a control system in a handpiece. Different designs of the apparatus implementing the proposed solution are disclosed.