diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-08-12 16:52:53 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-08-12 16:52:53 +0900 |
| commit | d734ff7d298d0abee4e6f75f94afd2d33e0c8fc6 (patch) | |
| tree | 704597e9a322ca8fa85cf3db94ea51299e7fd076 /src/OptionHandlerFactory.cc | |
| parent | e2fcd6d72c577688160ce2ae3886edb67416525d (diff) | |
Added new file allocation method called 'trunc'
--file-allocation option can now take new value 'trunc'. 'trunc' uses
ftruncate() system call or platform-specific counterpart to truncate a
file to a specified length.
Diffstat (limited to 'src/OptionHandlerFactory.cc')
| -rw-r--r-- | src/OptionHandlerFactory.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index 2c329a71..1910f81c 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -354,14 +354,17 @@ OptionHandlerFactory::createOptionHandlers() handlers.push_back(op); } { + const std::string params[] = { V_NONE, V_PREALLOC, V_TRUNC, +#ifdef HAVE_SOME_FALLOCATE + V_FALLOC +#endif // HAVE_SOME_FALLOCATE + }; SharedHandle<OptionHandler> op(new ParameterOptionHandler (PREF_FILE_ALLOCATION, TEXT_FILE_ALLOCATION, V_PREALLOC, - V_NONE, V_PREALLOC, -#ifdef HAVE_SOME_FALLOCATE - V_FALLOC, -#endif // HAVE_SOME_FALLOCATE + std::vector<std::string> + (vbegin(params), vend(params)), 'a')); op->addTag(TAG_BASIC); op->addTag(TAG_FILE); |
