$IOChecks off$ lazarus / 10-Designer ---------------------------------------------------------------------- cazzajay · 2009-12-14 00:50 was the command in delphi for making any IO errors not raise an exception namely i am using the mkdir command to make a directory in win32 however if the directory already exists i want the application to ignore trying to make it and use the existing directory anyway silently is there some lazarus equivalent to this? thanks cj ---------------------------------------------------------------------- Phil · 2009-12-14 01:25 Quote from: cazzajay on December 14, 2009, 01:50:36 amwas the command in delphi for making any IO errors not raise an exception namely i am using the mkdir command to make a directory in win32 however if the directory already exists i want the application to ignore trying to make it and use the existing directory anyway silently is there some lazarus equivalent to this? thanks cj Yes, but probably a safer approach is just to check if directory exists and, if so, don't call mkdir. Turning off exceptions probably not a good habit. Thanks. -Phil ---------------------------------------------------------------------- Mike J · 2009-12-14 03:33 Couldn't you just use a try finally block to ignore the exception ? ---------------------------------------------------------------------- marcov · 2009-12-14 07:48 Uses procedure "Forcedirectory" (or forcedirectories) ---------------------------------------------------------------------- cazzajay · 2009-12-14 11:18 Quote from: Phil on December 14, 2009, 02:25:09 amQuote from: cazzajay on December 14, 2009, 01:50:36 amwas the command in delphi for making any IO errors not raise an exception namely i am using the mkdir command to make a directory in win32 however if the directory already exists i want the application to ignore trying to make it and use the existing directory anyway silently is there some lazarus equivalent to this? thanks cj Yes, but probably a safer approach is just to check if directory exists and, if so, don't call mkdir. Turning off exceptions probably not a good habit. Thanks. -Phil thanks phil, how do i check if it exists. i know "fileexists" but didnt realise there was a directory equivalent! and thanks to all the other guys - if phil's suggestion works, i think it will be the most "solid" solution ---------------------------------------------------------------------- cazzajay · 2009-12-14 12:41 after not being lazy and doing some research it seems you use "directoryexists".  lol.