[Mono-dev] File accesses in ported applications

Sebastien Pouliot sebastien.pouliot at gmail.com
Wed May 2 09:05:37 EDT 2007


While it wouldn't be too hard to make a Gendarme rule, it would not give
results as good as a runtime-based solution. 

The main reason being that all string/Path API being used to construct a
file + user input would make any rule miss *a lot* of cases and also
reports some (but probably not much) false positives.

Of course the best is to have both (rule & runtime support ;-)

On Wed, 2007-05-02 at 13:17 +0100, Dick Porter wrote:
> Wed May 02 11:32:40 <@grendel> Dick: do you think it would be possible to write a file analyzer?
> Wed May 02 11:32:43 <@grendel> file access analyzer
> Wed May 02 11:33:18 <@Dick> how about an aspx-lint that checks for this sort of thing?
> Wed May 02 11:33:37 <@grendel> Dick: the lint would have to be either a monitor app or inside Mono
> Wed May 02 11:33:42 <@grendel> it's not aspx-specific, IMHO
> Wed May 02 11:33:48 <@Dick> i was thinking separate app
> Wed May 02 11:33:52 <@grendel> it can affect WF apps too
> Wed May 02 11:33:59 <@Dick> anyway, what would your file access analyzer do?
> Wed May 02 11:34:26 <@grendel> it would check for cases when an app is inconsistently accessing a file with the same case-insensitive name
> Wed May 02 11:34:35 <@grendel> e.g. someFile.txt, somefIle.txt etc
> Wed May 02 11:34:41 <@Dick> hmm
> Wed May 02 11:34:46 <@Dick> that could be handy
> Wed May 02 11:34:46 <@grendel> and would warn about the method, file, line where it happened
> Wed May 02 11:34:52 <@grendel> and output a report
> Wed May 02 11:34:59 <@grendel> it would be a great aid in porting
> Wed May 02 11:35:08 <@Dick> yeah
> Wed May 02 11:35:21 <@grendel> it could also look at the disk and check if there are files of the same flatten names in the same dir
> Wed May 02 11:35:22 <@Dick> i wonder if it would fit inside gendarme?
> Wed May 02 11:35:26 <@grendel> and make that a critical working
> Wed May 02 11:35:27 <@Dick> or moma
> Wed May 02 11:35:42 <@grendel> hm, moma would be a better choice I think
> Wed May 02 11:36:02 <@grendel> Dick: although I'm inclined to think it would just as well be a good thing to put in the runtime
> Wed May 02 11:36:08 <@grendel> and enable it along with IOMAP
> Wed May 02 11:36:22 <@Dick> yeah, thats definitely possible
> Wed May 02 11:36:30 <@grendel> it would take care of all the cases
> Wed May 02 11:36:50 <@grendel> you could output the diags to console on *nix and to the event sink on windows
> Wed May 02 11:36:54 <@Dick> the problem would be noticing the output if its was stuck there
> Wed May 02 11:37:22 <@grendel> yeah, but you can't do much about it
> Wed May 02 11:37:29 <@grendel> people must know the feature exists and where to find it
> Wed May 02 11:37:35 <@grendel> we put it in the docs and that's it
> Wed May 02 11:37:56 <@Dick> personally i'd put it in moma first and the runtime second
> Wed May 02 11:37:57 <@grendel> you could even enable it conditionally
> Wed May 02 11:38:08 <@grendel> Dick: that might be a good idea for testing, yeah
> Wed May 02 11:38:19 <@Dick> it would have to be conditional, saving all the filenames would be time and memory consuming
> Wed May 02 11:38:30 <@grendel> true
> Wed May 02 11:38:55  * Dick wonders if miguel or jpobst|gone is going to notice this
> Wed May 02 11:39:13 <@grendel> Dick: cut-n-paste and mail to them? :)
> Wed May 02 11:39:26 <@Dick> hopefully they might notice their names light up :)
> Wed May 02 11:39:41 <@Dick> sending it to xml or mono-devel would be good though
> Wed May 02 11:39:50 <@grendel> miguel: read what's above this line :)
> Wed May 02 11:39:56 <@grendel> jpobst|gone: read what's above this line :)
> Wed May 02 11:40:21 <@grendel> Dick: that's true
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-- 
Sebastien Pouliot  <sebastien at ximian.com>
Blog: http://pages.infinit.net/ctech/




More information about the Mono-devel-list mailing list