git-svn-id: https://profuse.googlecode.com/svn/branches/v2@293 aa027e90-d47c-11dd-86d7-074df07e0730

This commit is contained in:
ksherlock 2010-05-29 18:11:34 +00:00
parent 80a0061d92
commit 56ee715e01

View File

@ -146,6 +146,17 @@ void commandUsage(unsigned command)
}
bool isReadOnly(const char *command)
{
if (!::strcasecmp(command, "mv")) return false;
if (!::strcasecmp(command, "rm")) return false;
if (!::strcasecmp(command, "cp")) return false;
if (!::strcasecmp(command, "put")) return false;
if (!::strcasecmp(command, "krunch")) return false;
return true;
}
// from BSD rm, prompt question on stderr.
bool yes_or_no()
@ -708,7 +719,7 @@ int main(int argc, char **argv)
// should we peek at the action to determine if read only?
device.reset( Device::BlockDevice::Open(file, false, fmt) );
device.reset( Device::BlockDevice::Open(file, isReadOnly(action), fmt) );