Re: question on func get_file_info

new topic     » goto parent     » topic index » view thread      » older message » newer message

Salix wrote:
> 
> Is there a better/simplier/faster solution for this?
> 
> }}}
<eucode>
> include file.e
> 
> function get_file_info(sequence x)
> 	object dx
> 	dx=dir(x)
> 	if length(dx)=1 then --<-- possible error; need test

You'll get an error here if directory x doesn't exist because x will be a
atom and you can't get the length of an atom.

> 		return dx[1]
> 	end if
> 	return 0
> end function
> </eucode>
{{{

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu