Subscribe to the RSS feed then follow me on twitter at @mrlacey

Wednesday, January 23, 2008

EDSK ... not to make assumptions about a file system

Every developer should know not to make assumptions about a file system.

Don't assume that certain folders or drives will ever exist on the machine your software will be deployed on.

Also, don't assume you will have permission to access a location.

Why is this important?

If you assume a certain drive or folder will exist, or you have permission to access it but it doesn't or you don't. You software is likely to fail in unpredicted ways.

What do you do once you know this?

Test all assumptions. In code.
Want to install to the C drive? Test it exists first.
Want to write a file to a particular directory? Check it exists and you have permissions to write to it.

What do you think?
Is this something every developer should know? Have you say in the comments.

If you've built Windows Phone or Windows Store apps you can cross-promote them with AdDuplex to get more users.

1 comment:

  1. oakley sunglasses cheap,
    ray ban sunglasses sale,
    true religion jeans,
    snow boots outlet,
    coach outlet store,
    stuart weitzman sale,
    giuseppe zanotti sale,
    ugg outlet,
    parajumpers sale,
    los angeles clippers,
    tiffany jewelry,
    calvin klein,calvin klein outlet online,calvin klein wholesale,calvin klein shoes,calvin klein underwear,calvin klein coats,calvin klein handbags
    cheap ugg boots,
    michael kors uk,
    ray ban sunglasses,ray ban sunglasses outlet,ray ban,rayban,ray bans,ray ban outlet,ray-ban,raybans,ray ban wayfarer,ray-ban sunglasses,,rayban sunglasses,cheap ray ban
    arizona cardinals,
    manchester united jersey,
    kkk10 13