Xref: utzoo comp.sys.intel:1138 comp.unix.i386:3260 comp.unix.questions:20319 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwm.edu!cs.utexas.edu!samsung!aplcen!haven!umbc3!umbc5.umbc.edu!cs223130 From: cs223130@umbc5.umbc.edu (CMSC 223/01011) Newsgroups: comp.sys.intel,comp.unix.i386,comp.unix.questions Subject: Unlinking files mimicing "rm -f" Keywords: Unlinking Message-ID: <2885@umbc3.UMBC.EDU> Date: 2 Mar 90 04:24:33 GMT References: <288@hitachi.uucp> Sender: newspost@umbc3.UMBC.EDU Reply-To: cs223130@umbc5.umbc.edu.UUCP (CMSC 223/01011) Distribution: usa Organization: University of Maryland, Baltimore County Lines: 36 The discussion regarding the efficency of unlink() -vs- chdir() has reminded me of a problem I have encountered that maybe someone on the net could help me with. I had written a routine that a daemon process uses to remove files from a directory based on certain criteria. The problem I have run across concerns different ownerships of files in a directory by another owner. For example... drwxrwx--- joeblow joesgrp foodir is owned by "joeblow", yet files in the directory are owned by most anyone in "joesgrp". (i.e. janedoe or danquayl). The problem arises when a process running as joeblow wants to remove entries in "foodir" that are not owned by him. A regular call to unlink() prompts the user if they really want to remove the file. How do I disable this feature in a C program using UNIX system calls -vs- invoking "system("rm -f filename)" which seems to be slower because of an additional call to invoke the shell. It is also desirable for a daemon process that wants no user interaction whatsoever. This process runs on System V version 2.2. (Yeah I know it's old but I have no say on upgrades) The machine is an AT&T 3b15. Any help with this would be greatly appreciated. Thanks in advance, Dan Brown P.S. To clarify, The problem will only arise when the file owned by janedoe does not give write permissions to joeblow or joesgrp. I can't remember the exact wording of the question but I think is goes something like this. "rm filename mode?" Again thanks.