--- /dev/null
+<samba:parameter name="hide new files timeout"
+ context="S"
+ type="integer"
+ xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+ <description>
+ <para>Setting this parameter to something but 0 hides files
+ that have been modified less than N seconds ago.</para>
+ <para>It can be used for ingest/process queue style workloads. A
+ processing application should only see files that are definitely
+ finished. As many applications do not have proper external workflow
+ control, this can be a way to make sure processing does not
+ interfere with file ingest.</para>
+</description>
+<value type="default">0</value>
+</samba:parameter>
bool hide_unreadable = lp_hide_unreadable(SNUM(conn));
bool hide_unwriteable = lp_hide_unwriteable_files(SNUM(conn));
bool hide_special = lp_hide_special_files(SNUM(conn));
+ int hide_new_files_timeout = lp_hide_new_files_timeout(SNUM(conn));
char *entry = NULL;
struct smb_filename *smb_fname_base = NULL;
bool ret = false;
return False;
}
- if (hide_unreadable || hide_unwriteable || hide_special) {
+ if (hide_unreadable ||
+ hide_unwriteable ||
+ hide_special ||
+ (hide_new_files_timeout != 0))
+ {
entry = talloc_asprintf(talloc_tos(), "%s/%s", dir_path, name);
if (!entry) {
ret = false;
ret = false;
goto out;
}
+
+ if (hide_new_files_timeout != 0) {
+
+ double age = timespec_elapsed(
+ &smb_fname_base->st.st_ex_mtime);
+
+ if (age < (double)hide_new_files_timeout) {
+ ret = false;
+ goto out;
+ }
+ }
}
ret = true;