	function name_lun,lun

;+
;	Function name_lun returns the string-type 6-dimen-
;	sional array containing file name of the input 
;	logical unit number selected from full path name;
;	file name without extension; extension and lengthes
;	of all of these values correspondingly. All the 
;	output values are of lower case.
;
;	EXAMPLE:
;		If 1 is opened file C:\DATA\TEST1.DAT:
;			A=NAME_LUN(1)
;			PRINT,A
;	IDL prints: test1.dat  test1  dat  9  5  3
;
;		To extract, e.g., the extension only, you
;	can print such a statement:	
;		PRINT,(NAME_LUN(1))(2)
;	IDL prints: dat
;
;-

Descr_file = FSTAT(lun)

err_mess='ERROR: Unit number '+string(lun)+' is not open'

	if Descr_file.open eq 0 then begin
	print, strcompress(err_mess)
	arr=strarr(6)
	goto,exit
	endif

arr=name_extract(Descr_file.Name)

exit:
	return,arr

	end
