	program mainspec

	include 	'filparts.h'
	character	FileSpec(FIL__NPARTS)*(FIL__LENGTH)
	character	str*80
	character	cstr1*40
	character	cstr2*40
	character	cstr3*40
	character	cstr4*40

	call AskChar('new dir',str)
	cstr4 = str

	i = iSetfileSpec(str)
	idrop = iFileStructure(filespec)
	print *, 'components:'
	print *, 'node       ',FileSpec(1)
	print *, 'device     ',FileSpec(2)
	print *, 'directory  ',FileSpec(3)
	print *, 'name       ',FileSpec(4)
	print *, 'type       ',FileSpec(5)
	print *, 'version    ',FileSpec(6)

	print *, ' '
	print *, 'full specs:'
	i = igetfilespec(0,FIL__DEVICE,str)
	print *, 'device    :', str(:i),'<'
	i = igetfilespec(0,FIL__DIRECTORY,str)
	print *, 'directory :',str(:i),'<'
	i = igetfilespec(0,FIL__TYPE,str)
	print *, 'file name :',str(:i),'<'
	i = igetparentdirectory(str)
	print *, 'parent    :',str(:i),'<'
	i = igettopdirectory(str)
	print *, 'top dir   :',str(:i),'<'

	print *,' '
	print *, igetdirectoryfragment(0,cstr1)
	print *,'full  >', cstr1
	print *, igetdirectoryfragment(1,cstr1)
	print *,'top   >', cstr1
	print *, igetdirectoryfragment(2,cstr1)
	print *,'parent>', cstr1
	print *, igetdirectoryfragment(3,cstr1)
	print *,'sub   >', cstr1

	print *, idir2file(cstr4,cstr1)
	print *, cstr1
	print *, ifile2dir(cstr1,cstr2)
	print *, cstr2
	end
