{"id":4674,"date":"2022-12-20T18:36:45","date_gmt":"2022-12-20T21:36:45","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/mlocate-db-man5\/"},"modified":"2022-12-20T18:36:45","modified_gmt":"2022-12-20T21:36:45","slug":"mlocate-db-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/mlocate-db-man5\/","title":{"rendered":"mlocate.db (man5)"},"content":{"rendered":"<h1 align=\"center\">mlocate.db<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">mlocate.db \u2212 a mlocate database<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A mlocate database starts with a file header: 8 bytes for a magic number (<b>&#8220;\u0000mlocate&#8221;<\/b> like a C literal), 4 bytes for the <i>configuration block<\/i> size in big endian, 1 byte for file format version (<b>0<\/b>), 1 byte for the \u201crequire visibility\u201d flag (<b>0<\/b> or <b>1<\/b>), 2 bytes padding, and a NUL-terminated path name of the root of the database.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The header is followed by a <i>configuration block<\/i>, included to ensure databases are not reused if some configuration changes could affect their contents. The size of the configuration block in bytes is stored in the file header. The configuration block is a sequence of <i>variable assignments<\/i>, ordered by variable name. Each <i>variable assignment<\/i> consists of a NUL-terminated variable name and an ordered list of NUL-terminated values. The value list is terminated by one more <small>NUL<\/small> character. The ordering used is defined by the <b>strcmp ()<\/b> function.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Currently defined variables are: <b><br \/> prune_bind_mounts<\/b><\/p>\n<p style=\"margin-left:22%;\">A single entry, the value of PRUNE_BIND_MOUNTS; one of the strings <b>0<\/b> or <b>1<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>prunefs<\/b><\/p>\n<p style=\"margin-left:22%;\">The value of <b>PRUNEFS<\/b>, each entry is converted to uppercase.<\/p>\n<p style=\"margin-left:11%;\"><b>prunepaths<\/b><\/p>\n<p style=\"margin-left:22%;\">The value of <b>PRUNEPATHS<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The rest of the file until <small>EOF<\/small> describes directories and their contents. Each directory starts with a header: 8 bytes for <i>directory time<\/i> (seconds) in big endian, 4 bytes for <i>directory time<\/i> (nanoseconds) in big endian (0 if unknown, less than 1,000,000,000), 4 bytes padding, and a NUL-terminated path name of the the directory. Directory contents, a sequence of <i>file entries<\/i> sorted by name, follow.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>Directory time<\/i> is the maximum of <b>st_ctime<\/b> and <b>st_mtime<\/b> of the directory. <b>updatedb<\/b>(8) uses the original data if the <i>directory time<\/i> in the database and in the file system match exactly. <i>Directory time<\/i> equal to 0 always causes rescanning of the directory: this is necessary to handle directories which were being updated while building the database.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Each <i>file entry<\/i> starts with a single byte, marking its type:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p><b>0<\/b><\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>A non-directory file. Followed by a NUL-terminated file (not path) name.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p><b>1<\/b><\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>A subdirectory. Followed by a NUL-terminated file (not path) name.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p><b>2<\/b><\/p>\n<\/td>\n<td width=\"10%\"><\/td>\n<td width=\"78%\">\n<p>Marks the end of the current directory.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>locate(1)<\/b> only reports file entries, directory names are not reported because they are reported as an entry in their parent directory. The only exception is the root directory of the database, which is stored in the file header.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Miloslav Trmac <mitr@redhat.com><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>locate<\/b>(1), <b>updatedb.conf<\/b>(5), <b>updatedb<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  mlocate.db \u2212 a mlocate database <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[959],"tags":[961,1291,1604],"class_list":["post-4674","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-man5","tag-mlocate"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4674"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4674\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}