A device for measuring the length of a root canal of a subject is provided. The device includes a flexible sheath slidable over a dental handpiece head. The sheath includes electrically conducting wires for connecting to an apex locator. Also provided is a device for measuring root canal length that includes an endodontic file having a metallic element at the file end far from the end inserted into a root canal. The modified file provides a region in the metallic element for electronic attachment to an apex locator such that the rubber stopper may be moved along the entire file surface without interference.