mirror of
https://github.com/ksherlock/profuse.git
synced 2024-12-22 20:29:59 +00:00
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@293 aa027e90-d47c-11dd-86d7-074df07e0730
This commit is contained in:
parent
80a0061d92
commit
56ee715e01
13
apfm.cpp
13
apfm.cpp
@ -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) );
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user