summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:37 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:37 +0000
commitd38b7b3d803a719b189df80820aeda6a818f4909 (patch)
tree28143d1b948d8b31fc8bec91b50d2fdfe6ff3341 /apt-pkg/contrib/fileutl.cc
parentc217f42adc1a82c7400e85178f61bf429fea1bc4 (diff)
Needs Unpack fixes
Author: jgg Date: 1998-11-23 07:02:58 GMT Needs Unpack fixes
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 77e846117..3ca36377a 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: fileutl.cc,v 1.13 1998/10/26 07:11:49 jgg Exp $
+// $Id: fileutl.cc,v 1.14 1998/11/23 07:03:06 jgg Exp $
/* ######################################################################
File Utilities
@@ -119,6 +119,18 @@ string flNotDir(string File)
return string(File,Res,Res - File.length());
}
/*}}}*/
+// flNotFile - Strip the file from the directory name /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+string flNotFile(string File)
+{
+ string::size_type Res = File.rfind('/');
+ if (Res == string::npos)
+ return File;
+ Res++;
+ return string(File,0,Res);
+}
+ /*}}}*/
// SetCloseExec - Set the close on exec flag /*{{{*/
// ---------------------------------------------------------------------
/* */
@@ -184,12 +196,7 @@ FileFd::FileFd(string FileName,OpenMode Mode, unsigned long Perms)
case WriteAny:
iFd = open(FileName.c_str(),O_RDWR | O_CREAT,Perms);
- break;
-
- // Dont use this in public directories
- case LockEmpty:
- iFd = open(FileName.c_str(),O_RDWR | O_CREAT | O_TRUNC,Perms);
- break;
+ break;
}
if (iFd < 0)