|
From: | Charles Shuller |
Subject: | [DotGNU]engins/lib_dir.c |
Date: | Mon, 14 Oct 2002 16:07:08 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020923 |
Hey Guys --You probably already know, but in case you don't, I'm implementing System.IO.Directory in pnetlib. I will need to generate a listing of a directories contents, and differentiate between regular files and directories. The current function prototype in lib_dir.c:
ILInt32 _IL_DirMethods_GetFilesInDirectory(ILExecThread *_thread, ILString *path, ILString **files)
Modifies an ILString object. I can embed the filetype information in the string return, and then parse it out on the CSharp file, but to me, a better solution would be to implement a struct with all the pertinant information contained within. I think this would be more efficient than parsing a string. Of course, it logically follows that the file_info structs would need to be grouped into a list or an array. Are there any pre-existing functions to create a list/array easily? What about defining a new struct? Does chaning the StringObject return type violate some other standard (Looks like the Directory object should be the only code accessing it)? Finlly, is there some way to easily and clearly over-load the string object to really be an array of structs, and then typecast it into a more appropriate form?
Charles -- Charles Shuller Jabber ID: address@hidden
[Prev in Thread] | Current Thread | [Next in Thread] |