A
Alexandre
Hey im serializing objects to files am i forgeting something
it works great but once they are written i dont have access to deleting
them or overwriting them..
my folder properties are everyone can update delete and read and write
i set everything to everyone... juste to be sure.
and the owner of the file is the application is question...
heres my code
Alexandre ([email protected])
public static void save(string dir,string file, object o)
{
try
{
if(File.Exists(dir+file))
{
File.Delete(dir+file);
}
Stream stream = new
FileStream(dir+file,FileMode.Create,FileAccess.Write);
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream,o);
stream.Close();
}
catch(Exception e)
{
throw (new Exception(dir+file + " save ->> " +
e.Message));
}
}
it works great but once they are written i dont have access to deleting
them or overwriting them..
my folder properties are everyone can update delete and read and write
i set everything to everyone... juste to be sure.
and the owner of the file is the application is question...
heres my code
Alexandre ([email protected])
public static void save(string dir,string file, object o)
{
try
{
if(File.Exists(dir+file))
{
File.Delete(dir+file);
}
Stream stream = new
FileStream(dir+file,FileMode.Create,FileAccess.Write);
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream,o);
stream.Close();
}
catch(Exception e)
{
throw (new Exception(dir+file + " save ->> " +
e.Message));
}
}