mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-01-18 04:58:51 +02:00
Add timeModified parameter to HRN_STORAGE_PUT() macro.
This commit is contained in:
parent
065a8c8454
commit
c6208113bf
@ -77,6 +77,7 @@
|
|||||||
<commit subject="Replace defines with string constants in unit tests.">
|
<commit subject="Replace defines with string constants in unit tests.">
|
||||||
<github-pull-request id="1440"/>
|
<github-pull-request id="1440"/>
|
||||||
</commit>
|
</commit>
|
||||||
|
<commit subject="Add timeModified parameter to HRN_STORAGE_PUT() macro."/>
|
||||||
|
|
||||||
<release-item-contributor-list>
|
<release-item-contributor-list>
|
||||||
<release-item-contributor id="cynthia.shang"/>
|
<release-item-contributor id="cynthia.shang"/>
|
||||||
|
@ -403,15 +403,20 @@ hrnStoragePut(
|
|||||||
compressExtCat(fileStr, param.compressType);
|
compressExtCat(fileStr, param.compressType);
|
||||||
|
|
||||||
// Create file
|
// Create file
|
||||||
StorageWrite *destination = storageNewWriteP(storage, fileStr, .modeFile = param.modeFile);
|
StorageWrite *destination = storageNewWriteP(storage, fileStr, .modeFile = param.modeFile, .timeModified = param.timeModified);
|
||||||
IoFilterGroup *filterGroup = ioWriteFilterGroup(storageWriteIo(destination));
|
IoFilterGroup *filterGroup = ioWriteFilterGroup(storageWriteIo(destination));
|
||||||
|
|
||||||
// Add mode to output information filter
|
// Declare an information filter for displaying paramaters to the output
|
||||||
String *const filter = strNew();
|
String *const filter = strNew();
|
||||||
|
|
||||||
|
// Add mode to output information filter
|
||||||
if (param.modeFile != 0)
|
if (param.modeFile != 0)
|
||||||
strCatFmt(filter, "mode[%04o]", param.modeFile);
|
strCatFmt(filter, "mode[%04o]", param.modeFile);
|
||||||
|
|
||||||
|
// Add modified time to output information filter
|
||||||
|
if (param.timeModified != 0)
|
||||||
|
strCatFmt(filter, "%stime[%" PRIu64 "]", strEmpty(filter) ? "" : "/", (uint64_t)param.timeModified);
|
||||||
|
|
||||||
// Add compression filter
|
// Add compression filter
|
||||||
if (param.compressType != compressTypeNone)
|
if (param.compressType != compressTypeNone)
|
||||||
{
|
{
|
||||||
|
@ -190,6 +190,7 @@ typedef struct HrnStoragePutParam
|
|||||||
{
|
{
|
||||||
VAR_PARAM_HEADER;
|
VAR_PARAM_HEADER;
|
||||||
mode_t modeFile; // File mode if not the default
|
mode_t modeFile; // File mode if not the default
|
||||||
|
time_t timeModified; // Time file was last modified
|
||||||
CompressType compressType;
|
CompressType compressType;
|
||||||
CipherType cipherType;
|
CipherType cipherType;
|
||||||
const char *cipherPass;
|
const char *cipherPass;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user