Index: TECH/File/impl/FileWriter.cls.xml =================================================================== diff -u -r2378 -r2939 --- TECH/File/impl/FileWriter.cls.xml (.../FileWriter.cls.xml) (revision 2378) +++ TECH/File/impl/FileWriter.cls.xml (.../FileWriter.cls.xml) (revision 2939) @@ -83,6 +83,8 @@ Set Exception = ##class(TECH.Exceptions.FileException).%New("Bestand kon niet worden gesaved '"_Filename_"'",Status) Do ##class(TECH.ExceptionHandler).Throw(Exception) } + + Set Filename = ..FileCharacterStream.Filename // Nodig omdat de SaveStream het pad blijkbaar verandert. /// Close stream Set Status = ..FileCharacterStream.%Close() @@ -95,7 +97,7 @@ /// Handig voor snelheid bij wegschrijven naar netwerklocatie If ('..WriteImmediate){ Set Gelukt = ##class(%File).CopyFile(Filename,..Bestand) - If (##class(TECH.File).Exists(Filename)){ + If (##class(TECH.File).Exists(Filename)){ // TO DO: controleren of het doelbestand bestaat, i.p.v. het bronbestand niet meer? If (Gelukt){ Set DeleteGelukt = ##class(TECH.File).Delete(Filename) If 'DeleteGelukt{ @@ -107,6 +109,8 @@ Set Exception = ##class(TECH.Exceptions.FileException).%New("Bestand kon niet worden verplaatst. '"_Filename_"' naar '"_..Bestand_"'. "_Filename_" is verwijderd ? "_DeleteGelukt_".",0) Do ##class(TECH.ExceptionHandler).Throw(Exception) } + } Else { + Set Exception = ##class(TECH.Exceptions.FileException).%New("Tijdelijk bestand bestond niet '"_Filename_"'",0) } } Set ..FileCharacterStream = ""