Q:

Determine if a file is accesible

I want to determine if a file is accesible to read its contents or write inside, I use this code:
public bool Can_access_to_file(string FileIsAccesible_file)
{
    try {
        System.IO.FileStream Stream = new System.IO.FileStream(FileIsAccesible_file, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite);
        Stream.Close();
        return true;
    } catch {
        return false;
    }
}

I have some doubts about it, seems not a very good solution because it sets the file stream and that means for big files it will take so long to check, right?
What should I do to improve it?
Please supply or explain a better solution than my current code.

A:

Wrapping in a using statement ensures resources get cleaned up properly when you are done (+1 Rufus), however more to your question it does not matter the size of the file you are trying to check, as you are only ever initially reading to the set (or default) buffer size.
As you are only opening and closing and have not specified a buffer size (therefore default), you are only ever reading the first 4096 bytes of the file.
If you do not want to wrap in a using statement but still ensure you clean up after yourself, call Stream.Dispose() after you call Stream.Close()

