]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/fileutl.cc
Fixed the resetting of Dir with "dir {};". Closes: #87323
[apt.git] / apt-pkg / contrib / fileutl.cc
index 0907f4dcd3650a585833b505bb387f67d1688bce..db878064d8c02b233a8ef43546d30ef9eb758e0a 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: fileutl.cc,v 1.35 2001/02/20 07:03:17 jgg Exp $
+// $Id: fileutl.cc,v 1.37 2001/03/03 22:45:59 tausq Exp $
 /* ######################################################################
    
    File Utilities
@@ -403,6 +403,11 @@ bool FileFd::Open(string FileName,OpenMode Mode, unsigned long Perms)
       case WriteAny:
       iFd = open(FileName.c_str(),O_RDWR | O_CREAT,Perms);
       break;      
+
+      case WriteTemp:
+      unlink(FileName.c_str());
+      iFd = open(FileName.c_str(),O_RDWR | O_CREAT | O_EXCL,Perms);
+      break;
    }  
 
    if (iFd < 0)