2014-09-26 18:31:22 -04:00
|
|
|
/*
|
2026-02-23 13:22:21 -06:00
|
|
|
ISC License
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2026, Antonio SJ Musumeci <trapexit@spawn.link>
|
2014-09-26 18:31:22 -04:00
|
|
|
|
2016-01-14 16:50:22 -05:00
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
|
|
|
copyright notice and this permission notice appear in all copies.
|
2014-09-26 18:31:22 -04:00
|
|
|
|
2016-01-14 16:50:22 -05:00
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2014-09-26 18:31:22 -04:00
|
|
|
*/
|
|
|
|
|
|
2025-09-06 12:03:51 -04:00
|
|
|
#include "fuse_opendir.hpp"
|
|
|
|
|
|
2019-05-22 21:40:45 -04:00
|
|
|
#include "config.hpp"
|
2019-01-25 07:03:46 -05:00
|
|
|
#include "dirinfo.hpp"
|
2017-06-30 11:15:20 -04:00
|
|
|
|
2020-12-19 15:06:08 -05:00
|
|
|
#include "fuse.h"
|
|
|
|
|
|
2016-12-22 22:46:20 -05:00
|
|
|
|
2025-09-06 12:03:51 -04:00
|
|
|
int
|
2025-10-13 00:21:36 -04:00
|
|
|
FUSE::opendir(const fuse_req_ctx_t *ctx_,
|
|
|
|
|
const char *fusepath_,
|
|
|
|
|
fuse_file_info_t *ffi_)
|
2014-09-26 18:31:22 -04:00
|
|
|
{
|
2025-09-17 23:51:16 -04:00
|
|
|
DirInfo *di;
|
|
|
|
|
|
|
|
|
|
di = new DirInfo(fusepath_);
|
|
|
|
|
|
|
|
|
|
ffi_->fh = di->to_fh();
|
2019-01-25 07:03:46 -05:00
|
|
|
|
2025-09-06 12:03:51 -04:00
|
|
|
ffi_->noflush = true;
|
2023-10-23 22:32:42 -05:00
|
|
|
|
2025-09-06 12:03:51 -04:00
|
|
|
if(cfg.cache_readdir)
|
|
|
|
|
{
|
|
|
|
|
ffi_->keep_cache = true;
|
|
|
|
|
ffi_->cache_readdir = true;
|
|
|
|
|
}
|
2019-05-22 21:40:45 -04:00
|
|
|
|
2025-09-06 12:03:51 -04:00
|
|
|
return 0;
|
2014-09-26 18:31:22 -04:00
|
|
|
}
|