Extracting the List of Layer Names in a Drawing

Is there a way to extract the layer names in a drawing into an ASCII file?