Garg,

Not sure if you'v seen this or not as not everyone has read the entire manual and not too many have memorized it but using this method should prevent any file handle issue.

Code:
FreeFileHandle( )

Action: Returns the first available file handle.

Syntax: FreeFileHandle ( )

Parameters: None.

Returns: 0 No file handle available.
> 0 Numeric file handle.


See Also: Open( ), Close( ), ReadLine( ), WriteLine( )

Example: $Handle = FreeFileHandle()
IF $Handle > 0
IF Open($Handle, @LDRIVE + "\CONFIG\SETTINGS.INI") = 0
;………
ENDIF
ENDIF