Ver Fonte

Temporary file renaming works now both in Virtualbox and natively

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6960 8c9fc860-2736-0410-a75d-ab315db34111
felixf há 8 anos atrás
pai
commit
59e9b2382a
1 ficheiros alterados com 3 adições e 4 exclusões
  1. 3 4
      source/Generic.Unix.UnixFiles.Mod

+ 3 - 4
source/Generic.Unix.UnixFiles.Mod

@@ -829,11 +829,10 @@ TYPE
 							Halt( SELF, FALSE, "UnixFiles.File.Register: rename failed" )  
 						END;
 
-						IF fo # NoDesc THEN 
-							TRACE(fo, fd); 
-							res := Unix.close(fo); 
+						IF fo # NoDesc THEN (* SELF still refers to old file *)
+							res := Unix.close(fd); 
 							res := Unix.unlink(ADDRESSOF(workName));  (* VirtualBox ! Can only delete file when closed. *)
-							fd := Unix.open( ADDRESSOF( registerName ), CreateFlags, Unix.rwrwr );
+							fd := Unix.open( ADDRESSOF( registerName ), Unix.rdwr, Unix.rwrwr );
 						END;
 
 						workName := registerName;  registerName := "";  tempFile := FALSE;