cross platform file class impletement.