1using System.Collections.Generic;
6 public partial class FileManager
15 return Open( fileName,
true );
23 public virtual bool Exists(
string fileName )
27 return FMAssert( File.Exists,
false,
false, fileName ) ||
FMAssert( Directory.Exists,
false,
false, fileName );
40 Stream stream = FMAssert<string, bool, Stream?>(
openFileStream, write,
null, fileName, write );
46 FileMode mode = write ? FileMode.Create : FileMode.Open;
47 FileAccess access = write ? FileAccess.ReadWrite : FileAccess.Read;
48 return new FileStream( fileName, mode, access );
56 public virtual void Delete(
string fileName )
60 FMAssert( File.Delete,
true, fileName );
Stream openFileStream(string fileName, bool write)
virtual void Delete(string fileName)
Poistaa tiedoston. Ei heitä poikkeusta, jos tiedostoa ei ole olemassa.
void FMAssert(Action func, bool write)
StorageFile Create(string fileName)
Luo uuden tiedoston
virtual StorageFile Open(string fileName, bool write)
Avaa tiedoston.
virtual bool Exists(string fileName)
Kertoo onko tiedosto tai hakemisto olemassa.
void MakeAbsolute(ref string path)