Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::OpenerFileSystem Class Referenceabstract
Inheritance diagram for duckdb::OpenerFileSystem:
Collaboration diagram for duckdb::OpenerFileSystem:

Public Member Functions

virtual FileSystem & GetFileSystem () const =0
virtual optional_ptr< FileOpener > GetOpener () const =0
void VerifyNoOpener (optional_ptr< FileOpener > opener)
void VerifyCanAccessDirectory (const string &path)
void VerifyCanAccessFile (const string &path)
void VerifyCanAccessExtension (const string &path, const FileOpenFlags &flags)
bool IsDuckDBExtensionName (const string &path)
void Read (FileHandle &handle, void *buffer, int64_t nr_bytes, idx_t location) override
void Write (FileHandle &handle, void *buffer, int64_t nr_bytes, idx_t location) override
int64_t Read (FileHandle &handle, void *buffer, int64_t nr_bytes) override
int64_t Write (FileHandle &handle, void *buffer, int64_t nr_bytes) override
 Write nr_bytes from the buffer into the file, moving the file pointer forward by nr_bytes.
int64_t GetFileSize (FileHandle &handle) override
 Returns the file size of a file handle, returns -1 on error.
timestamp_t GetLastModifiedTime (FileHandle &handle) override
 Returns the file last modified time of a file handle, returns timespec with zero on all attributes on error.
string GetVersionTag (FileHandle &handle) override
FileType GetFileType (FileHandle &handle) override
 Returns the file type of the attached handle.
FileMetadata Stats (FileHandle &handle) override
 Returns the file stats of the attached handle.
void Truncate (FileHandle &handle, int64_t new_size) override
void FileSync (FileHandle &handle) override
 Sync a file handle to disk.
bool DirectoryExists (const string &directory, optional_ptr< FileOpener > opener) override
 Check if a directory exists.
void CreateDirectory (const string &directory, optional_ptr< FileOpener > opener) override
 Create a directory if it does not exist.
void RemoveDirectory (const string &directory, optional_ptr< FileOpener > opener) override
 Recursively remove a directory and all files in it.
void MoveFile (const string &source, const string &target, optional_ptr< FileOpener > opener) override
string GetHomeDirectory () override
 Gets the users home directory.
string ExpandPath (const string &path) override
 Expands a given path, including e.g. expanding the home directory of the user.
bool FileExists (const string &filename, optional_ptr< FileOpener > opener) override
 Check if a file exists.
bool IsPipe (const string &filename, optional_ptr< FileOpener > opener) override
 Check if path is pipe.
void RemoveFile (const string &filename, optional_ptr< FileOpener > opener) override
 Remove a file from disk.
bool TryRemoveFile (const string &filename, optional_ptr< FileOpener > opener) override
 Remvoe a file from disk if it exists - if it does not exist, return false.
void RemoveFiles (const vector< string > &filenames, optional_ptr< FileOpener > opener) override
 Remove multiple files from disk - does not error if any file does not exist.
string PathSeparator (const string &path) override
 Path separator for path.
vector< OpenFileInfo > Glob (const string &path, FileOpener *opener=nullptr) override
 Runs a glob on the file system, returning a list of matching files.
std::string GetName () const override
 Return the name of the filesytem. Used for forming diagnosis messages.
void RegisterSubSystem (unique_ptr< FileSystem > sub_fs) override
 registers a sub-file system to handle certain file name prefixes, e.g. http:// etc.
void RegisterSubSystem (FileCompressionType compression_type, unique_ptr< FileSystem > fs) override
void UnregisterSubSystem (const string &name) override
 Unregister a sub-filesystem by name.
unique_ptr< FileSystem > ExtractSubSystem (const string &name) override
void SetDisabledFileSystems (const vector< string > &names) override
bool SubSystemIsDisabled (const string &name) override
bool IsDisabledForPath (const string &path) override
 Check if the filesystem that would handle this path is disabled.
vector< string > ListSubSystems () override
 List registered sub-filesystems, including builtin ones.
Public Member Functions inherited from duckdb::FileSystem
virtual DUCKDB_API unique_ptr< FileHandle > OpenFile (const string &path, FileOpenFlags flags, optional_ptr< FileOpener > opener=nullptr)
DUCKDB_API unique_ptr< FileHandle > OpenFile (const OpenFileInfo &path, FileOpenFlags flags, optional_ptr< FileOpener > opener=nullptr)
virtual DUCKDB_API bool Trim (FileHandle &handle, idx_t offset_bytes, idx_t length_bytes)
virtual DUCKDB_API void CreateDirectoriesRecursive (const string &path, optional_ptr< FileOpener > opener=nullptr)
 Helper function that uses DirectoryExists and CreateDirectory to ensure all directories in path are created.
virtual DUCKDB_API bool ListFiles (const string &directory, const std::function< void(const string &, bool)> &callback, FileOpener *opener=nullptr)
 List files in a directory, invoking the callback method for each one with (filename, is_dir).
DUCKDB_API bool ListFiles (const string &directory, const std::function< void(OpenFileInfo &info)> &callback, optional_ptr< FileOpener > opener=nullptr)
virtual DUCKDB_API bool IsPathAbsolute (const string &path)
 Checks if path is is an absolute path.
DUCKDB_API string JoinPath (const string &a, const string &path)
 Join two paths together.
template<typename... ARGS>
string JoinPath (const string &a, const string &b, ARGS... args)
DUCKDB_API string ConvertSeparators (const string &path)
 Convert separators in a path to the local separators (e.g. convert "/" into \ on windows).
DUCKDB_API string ExtractBaseName (const string &path)
 Extract the base name of a file (e.g. if the input is lib/example.dll the base name is 'example').
DUCKDB_API string ExtractExtension (const string &path)
 Extract the extension of a file (e.g. if the input is lib/example.dll the extension is 'dll').
DUCKDB_API string ExtractName (const string &path)
 Extract the name of a file (e.g if the input is lib/example.dll the name is 'example.dll').
DUCKDB_API unique_ptr< MultiFileList > Glob (const string &path, const FileGlobInput &input, optional_ptr< FileOpener > opener)
DUCKDB_API unique_ptr< MultiFileList > GlobFileList (const string &path, const FileGlobInput &input=FileGlobOptions::DISALLOW_EMPTY)
DUCKDB_API vector< OpenFileInfo > GlobFiles (const string &pattern, const FileGlobInput &input=FileGlobOptions::DISALLOW_EMPTY)
virtual DUCKDB_API bool CanHandleFile (const string &fpath)
 Whether or not a sub-system can handle a specific file path.
virtual DUCKDB_API void Seek (FileHandle &handle, idx_t location)
 Set the file pointer of a file handle to a specified location. Reads and writes will happen from this location.
virtual DUCKDB_API void Reset (FileHandle &handle)
 Reset a file to the beginning (equivalent to Seek(handle, 0) for simple files).
virtual DUCKDB_API idx_t SeekPosition (FileHandle &handle)
virtual DUCKDB_API bool IsManuallySet ()
 If FS was manually set by the user.
virtual DUCKDB_API bool CanSeek ()
 Whether or not we can seek into the file.
virtual DUCKDB_API bool OnDiskFile (FileHandle &handle)
virtual DUCKDB_API unique_ptr< FileHandle > OpenCompressedFile (QueryContext context, unique_ptr< FileHandle > handle, bool write)
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Protected Member Functions

unique_ptr< FileHandle > OpenFileExtended (const OpenFileInfo &file, FileOpenFlags flags, optional_ptr< FileOpener > opener=nullptr) override
bool SupportsOpenFileExtended () const override
bool ListFilesExtended (const string &directory, const std::function< void(OpenFileInfo &info)> &callback, optional_ptr< FileOpener > opener) override
bool SupportsListFilesExtended () const override
unique_ptr< MultiFileList > GlobFilesExtended (const string &path, const FileGlobInput &input, optional_ptr< FileOpener > opener) override
bool SupportsGlobExtended () const override
string CanonicalizePath (const string &path_p, optional_ptr< FileOpener > opener=nullptr) override
 Canonicalize a path.

Private Member Functions

void VerifyCanAccessFileInternal (const string &path, FileType type)

Additional Inherited Members

Static Public Member Functions inherited from duckdb::FileSystem
static DUCKDB_API FileSystem & GetFileSystem (ClientContext &context)
static DUCKDB_API FileSystem & GetFileSystem (DatabaseInstance &db)
static DUCKDB_API FileSystem & Get (AttachedDatabase &db)
static DUCKDB_API void SetWorkingDirectory (const string &path)
 Sets the working directory.
static DUCKDB_API string GetWorkingDirectory ()
 Gets the working directory.
static DUCKDB_API string GetHomeDirectory (optional_ptr< FileOpener > opener)
 Gets the users home directory.
static DUCKDB_API string ExpandPath (const string &path, optional_ptr< FileOpener > opener)
 Expands a given path, including e.g. expanding the home directory of the user.
static DUCKDB_API optional_idx GetAvailableMemory ()
 Returns the system-available memory in bytes. Returns DConstants::INVALID_INDEX if the system function fails.
static DUCKDB_API optional_idx GetAvailableDiskSpace (const string &path)
 Returns the space available on the disk. Returns DConstants::INVALID_INDEX if the information was not available.
static DUCKDB_API string GetEnvVariable (const string &name)
 Returns the value of an environment variable - or the empty string if it is not set.
static DUCKDB_API bool HasGlob (const string &str)
 Whether there is a glob in the string.
static DUCKDB_API unique_ptr< FileSystem > CreateLocal ()
 Create a LocalFileSystem.
static DUCKDB_API bool IsRemoteFile (const string &path)
 Whether or not a file is remote or local, based only on file path.
static DUCKDB_API bool IsRemoteFile (const string &path, string &extension)
static DUCKDB_API bool IsDirectory (const OpenFileInfo &info)

Member Function Documentation

◆ VerifyNoOpener()

void duckdb::OpenerFileSystem::VerifyNoOpener ( optional_ptr< FileOpener > opener)
85334 {
85335 if (opener) {
85336 throw InternalException("OpenerFileSystem cannot take an opener - the opener is pushed automatically");
85337 }
85338}

◆ VerifyCanAccessDirectory()

void duckdb::OpenerFileSystem::VerifyCanAccessDirectory ( const string & path)
85359 {
85360 VerifyCanAccessFileInternal(path, FileType::FILE_TYPE_DIR);
85361}
@ FILE_TYPE_DIR
Directory.
Definition duckdb.hpp:8114

◆ VerifyCanAccessFile()

void duckdb::OpenerFileSystem::VerifyCanAccessFile ( const string & path)
85355 {
85356 VerifyCanAccessFileInternal(path, FileType::FILE_TYPE_REGULAR);
85357}
@ FILE_TYPE_REGULAR
Regular file.
Definition duckdb.hpp:8112

◆ VerifyCanAccessExtension()

void duckdb::OpenerFileSystem::VerifyCanAccessExtension ( const string & path,
const FileOpenFlags & flags )
inline
85112 {
85113 if (flags.OpenForWriting() && !flags.EnableExtensionInstall()) {
85114 throw PermissionException(
85115 "File '%s' cannot be opened for writing since files ending with '.duckdb_extension' are reserved for "
85116 "DuckDB extensions, and these can only be installed through the INSTALL command",
85117 path);
85118 }
85119 }

◆ IsDuckDBExtensionName()

bool duckdb::OpenerFileSystem::IsDuckDBExtensionName ( const string & path)
inline
85121 {
85122 return StringUtil::EndsWith(path, ".duckdb_extension");
85123 }
static DUCKDB_API bool EndsWith(const string &str, const string &suffix)
Returns true if the target string ends with the given suffix.
Definition duckdb.cpp:109384

◆ Read() [1/2]

void duckdb::OpenerFileSystem::Read ( FileHandle & handle,
void * buffer,
int64_t nr_bytes,
idx_t location )
inlineoverridevirtual

Read exactly nr_bytes from the specified location in the file. Fails if nr_bytes could not be read. This is equivalent to calling SetFilePointer(location) followed by calling Read().

Reimplemented from duckdb::FileSystem.

85125 {
85126 GetFileSystem().Read(handle, buffer, nr_bytes, location);
85127 }

◆ Write() [1/2]

void duckdb::OpenerFileSystem::Write ( FileHandle & handle,
void * buffer,
int64_t nr_bytes,
idx_t location )
inlineoverridevirtual

Write exactly nr_bytes to the specified location in the file. Fails if nr_bytes could not be written. This is equivalent to calling SetFilePointer(location) followed by calling Write().

Reimplemented from duckdb::FileSystem.

85129 {
85130 throw InternalException("writing on the OpenerFileSystem is undefined");
85131 }

◆ Read() [2/2]

int64_t duckdb::OpenerFileSystem::Read ( FileHandle & handle,
void * buffer,
int64_t nr_bytes )
inlineoverridevirtual

Read nr_bytes from the specified file into the buffer, moving the file pointer forward by nr_bytes. Returns the amount of bytes read.

Reimplemented from duckdb::FileSystem.

85133 {
85134 return GetFileSystem().Read(handle, buffer, nr_bytes);
85135 }

◆ Write() [2/2]

int64_t duckdb::OpenerFileSystem::Write ( FileHandle & handle,
void * buffer,
int64_t nr_bytes )
inlineoverridevirtual

Write nr_bytes from the buffer into the file, moving the file pointer forward by nr_bytes.

Reimplemented from duckdb::FileSystem.

85137 {
85138 return GetFileSystem().Write(handle, buffer, nr_bytes);
85139 }

◆ GetFileSize()

int64_t duckdb::OpenerFileSystem::GetFileSize ( FileHandle & handle)
inlineoverridevirtual

Returns the file size of a file handle, returns -1 on error.

Reimplemented from duckdb::FileSystem.

85141 {
85142 return GetFileSystem().GetFileSize(handle);
85143 }

◆ GetLastModifiedTime()

timestamp_t duckdb::OpenerFileSystem::GetLastModifiedTime ( FileHandle & handle)
inlineoverridevirtual

Returns the file last modified time of a file handle, returns timespec with zero on all attributes on error.

Reimplemented from duckdb::FileSystem.

85144 {
85145 return GetFileSystem().GetLastModifiedTime(handle);
85146 }

◆ GetVersionTag()

string duckdb::OpenerFileSystem::GetVersionTag ( FileHandle & handle)
inlineoverridevirtual

Returns a tag that uniquely identifies the version of the file, used for checking cache invalidation for CachingFileSystem httpfs files

Reimplemented from duckdb::FileSystem.

85147 {
85148 return GetFileSystem().GetVersionTag(handle);
85149 }

◆ GetFileType()

FileType duckdb::OpenerFileSystem::GetFileType ( FileHandle & handle)
inlineoverridevirtual

Returns the file type of the attached handle.

Reimplemented from duckdb::FileSystem.

85150 {
85151 return GetFileSystem().GetFileType(handle);
85152 }

◆ Stats()

FileMetadata duckdb::OpenerFileSystem::Stats ( FileHandle & handle)
inlineoverridevirtual

Returns the file stats of the attached handle.

Reimplemented from duckdb::FileSystem.

85153 {
85154 return GetFileSystem().Stats(handle);
85155 }

◆ Truncate()

void duckdb::OpenerFileSystem::Truncate ( FileHandle & handle,
int64_t new_size )
inlineoverridevirtual

Truncate a file to a maximum size of new_size, new_size should be smaller than or equal to the current size of the file

Reimplemented from duckdb::FileSystem.

85157 {
85158 GetFileSystem().Truncate(handle, new_size);
85159 }

◆ FileSync()

void duckdb::OpenerFileSystem::FileSync ( FileHandle & handle)
inlineoverridevirtual

Sync a file handle to disk.

Reimplemented from duckdb::FileSystem.

85161 {
85162 GetFileSystem().FileSync(handle);
85163 }

◆ DirectoryExists()

bool duckdb::OpenerFileSystem::DirectoryExists ( const string & directory,
optional_ptr< FileOpener > opener )
inlineoverridevirtual

Check if a directory exists.

Reimplemented from duckdb::FileSystem.

85165 {
85166 VerifyNoOpener(opener);
85167 VerifyCanAccessDirectory(directory);
85168 return GetFileSystem().DirectoryExists(directory, GetOpener());
85169 }

◆ CreateDirectory()

void duckdb::OpenerFileSystem::CreateDirectory ( const string & directory,
optional_ptr< FileOpener > opener )
inlineoverridevirtual

Create a directory if it does not exist.

Reimplemented from duckdb::FileSystem.

85170 {
85171 VerifyNoOpener(opener);
85172 VerifyCanAccessDirectory(directory);
85173 return GetFileSystem().CreateDirectory(directory, GetOpener());
85174 }

◆ RemoveDirectory()

void duckdb::OpenerFileSystem::RemoveDirectory ( const string & directory,
optional_ptr< FileOpener > opener )
inlineoverridevirtual

Recursively remove a directory and all files in it.

Reimplemented from duckdb::FileSystem.

85176 {
85177 VerifyNoOpener(opener);
85178 VerifyCanAccessDirectory(directory);
85179 return GetFileSystem().RemoveDirectory(directory, GetOpener());
85180 }

◆ MoveFile()

void duckdb::OpenerFileSystem::MoveFile ( const string & source,
const string & target,
optional_ptr< FileOpener > opener )
inlineoverridevirtual

Move a file from source path to the target, StorageManager relies on this being an atomic action for ACID properties

Reimplemented from duckdb::FileSystem.

85182 {
85183 VerifyNoOpener(opener);
85184 VerifyCanAccessFile(source);
85185 VerifyCanAccessFile(target);
85186 if (IsDuckDBExtensionName(target) && !IsDuckDBExtensionName(source)) {
85187 throw PermissionException(
85188 "File '%s' cannot be moved to '%s', files ending with '.duckdb_extension' are reserved for DuckDB "
85189 "extensions, and these can only be installed through the INSTALL command, or moved if both are "
85190 "extensions'",
85191 source, target);
85192 }
85193 GetFileSystem().MoveFile(source, target, GetOpener());
85194 }

◆ GetHomeDirectory()

string duckdb::OpenerFileSystem::GetHomeDirectory ( )
inlineoverridevirtual

Gets the users home directory.

Reimplemented from duckdb::FileSystem.

85196 {
85197 return FileSystem::GetHomeDirectory(GetOpener());
85198 }
virtual DUCKDB_API string GetHomeDirectory()
Gets the users home directory.
Definition duckdb.cpp:73868
Here is the call graph for this function:

◆ ExpandPath()

string duckdb::OpenerFileSystem::ExpandPath ( const string & path)
inlineoverridevirtual

Expands a given path, including e.g. expanding the home directory of the user.

Reimplemented from duckdb::FileSystem.

85200 {
85201 return FileSystem::ExpandPath(path, GetOpener());
85202 }
static DUCKDB_API string ExpandPath(const string &path, optional_ptr< FileOpener > opener)
Expands a given path, including e.g. expanding the home directory of the user.
Definition duckdb.cpp:73909
Here is the call graph for this function:

◆ FileExists()

bool duckdb::OpenerFileSystem::FileExists ( const string & filename,
optional_ptr< FileOpener > opener )
inlineoverridevirtual

Check if a file exists.

Reimplemented from duckdb::FileSystem.

85204 {
85205 VerifyNoOpener(opener);
85206 VerifyCanAccessFile(filename);
85207 return GetFileSystem().FileExists(filename, GetOpener());
85208 }

◆ IsPipe()

bool duckdb::OpenerFileSystem::IsPipe ( const string & filename,
optional_ptr< FileOpener > opener )
inlineoverridevirtual

Check if path is pipe.

Reimplemented from duckdb::FileSystem.

85210 {
85211 VerifyNoOpener(opener);
85212 return GetFileSystem().IsPipe(filename, GetOpener());
85213 }

◆ RemoveFile()

void duckdb::OpenerFileSystem::RemoveFile ( const string & filename,
optional_ptr< FileOpener > opener )
inlineoverridevirtual

Remove a file from disk.

Reimplemented from duckdb::FileSystem.

85214 {
85215 VerifyNoOpener(opener);
85216 VerifyCanAccessFile(filename);
85217 GetFileSystem().RemoveFile(filename, GetOpener());
85218 }

◆ TryRemoveFile()

bool duckdb::OpenerFileSystem::TryRemoveFile ( const string & filename,
optional_ptr< FileOpener > opener )
inlineoverridevirtual

Remvoe a file from disk if it exists - if it does not exist, return false.

Reimplemented from duckdb::FileSystem.

85220 {
85221 VerifyNoOpener(opener);
85222 VerifyCanAccessFile(filename);
85223 return GetFileSystem().TryRemoveFile(filename, GetOpener());
85224 }

◆ RemoveFiles()

void duckdb::OpenerFileSystem::RemoveFiles ( const vector< string > & filenames,
optional_ptr< FileOpener > opener )
inlineoverridevirtual

Remove multiple files from disk - does not error if any file does not exist.

Reimplemented from duckdb::FileSystem.

85226 {
85227 VerifyNoOpener(opener);
85228 for (const auto &filename : filenames) {
85229 VerifyCanAccessFile(filename);
85230 }
85231 GetFileSystem().RemoveFiles(filenames, GetOpener());
85232 }

◆ PathSeparator()

string duckdb::OpenerFileSystem::PathSeparator ( const string & path)
inlineoverridevirtual

Path separator for path.

Reimplemented from duckdb::FileSystem.

85234 {
85235 return GetFileSystem().PathSeparator(path);
85236 }

◆ Glob()

vector< OpenFileInfo > duckdb::OpenerFileSystem::Glob ( const string & path,
FileOpener * opener = nullptr )
inlineoverridevirtual

Runs a glob on the file system, returning a list of matching files.

Reimplemented from duckdb::FileSystem.

85238 {
85239 VerifyNoOpener(opener);
85240 VerifyCanAccessFile(path);
85241 return GetFileSystem().Glob(path, GetOpener().get());
85242 }
__host__ cudaTextureObject_t get() const noexcept
Here is the call graph for this function:

◆ GetName()

std::string duckdb::OpenerFileSystem::GetName ( ) const
inlineoverridevirtual

Return the name of the filesytem. Used for forming diagnosis messages.

Implements duckdb::FileSystem.

85244 {
85245 return "OpenerFileSystem - " + GetFileSystem().GetName();
85246 }

◆ RegisterSubSystem() [1/2]

void duckdb::OpenerFileSystem::RegisterSubSystem ( unique_ptr< FileSystem > sub_fs)
inlineoverridevirtual

registers a sub-file system to handle certain file name prefixes, e.g. http:// etc.

Reimplemented from duckdb::FileSystem.

85248 {
85249 GetFileSystem().RegisterSubSystem(std::move(sub_fs));
85250 }

◆ RegisterSubSystem() [2/2]

void duckdb::OpenerFileSystem::RegisterSubSystem ( FileCompressionType compression_type,
unique_ptr< FileSystem > fs )
inlineoverridevirtual

Reimplemented from duckdb::FileSystem.

85252 {
85253 GetFileSystem().RegisterSubSystem(compression_type, std::move(fs));
85254 }

◆ UnregisterSubSystem()

void duckdb::OpenerFileSystem::UnregisterSubSystem ( const string & name)
inlineoverridevirtual

Unregister a sub-filesystem by name.

Reimplemented from duckdb::FileSystem.

85256 {
85257 GetFileSystem().UnregisterSubSystem(name);
85258 }

◆ ExtractSubSystem()

unique_ptr< FileSystem > duckdb::OpenerFileSystem::ExtractSubSystem ( const string & name)
inlineoverridevirtual

Reimplemented from duckdb::FileSystem.

85260 {
85261 return GetFileSystem().ExtractSubSystem(name);
85262 }

◆ SetDisabledFileSystems()

void duckdb::OpenerFileSystem::SetDisabledFileSystems ( const vector< string > & names)
inlineoverridevirtual

Reimplemented from duckdb::FileSystem.

85264 {
85265 GetFileSystem().SetDisabledFileSystems(names);
85266 }

◆ SubSystemIsDisabled()

bool duckdb::OpenerFileSystem::SubSystemIsDisabled ( const string & name)
inlineoverridevirtual

Reimplemented from duckdb::FileSystem.

85268 {
85269 return GetFileSystem().SubSystemIsDisabled(name);
85270 }

◆ IsDisabledForPath()

bool duckdb::OpenerFileSystem::IsDisabledForPath ( const string & path)
inlineoverridevirtual

Check if the filesystem that would handle this path is disabled.

Reimplemented from duckdb::FileSystem.

85272 {
85273 return GetFileSystem().IsDisabledForPath(path);
85274 }

◆ ListSubSystems()

vector< string > duckdb::OpenerFileSystem::ListSubSystems ( )
inlineoverridevirtual

List registered sub-filesystems, including builtin ones.

Reimplemented from duckdb::FileSystem.

85276 {
85277 return GetFileSystem().ListSubSystems();
85278 }

◆ OpenFileExtended()

unique_ptr< FileHandle > duckdb::OpenerFileSystem::OpenFileExtended ( const OpenFileInfo & file,
FileOpenFlags flags,
optional_ptr< FileOpener > opener = nullptr )
inlineoverrideprotectedvirtual

Reimplemented from duckdb::FileSystem.

85282 {
85283 VerifyNoOpener(opener);
85284 VerifyCanAccessFile(file.path);
85285 if (IsDuckDBExtensionName(file.path)) {
85286 VerifyCanAccessExtension(file.path, flags);
85287 }
85288 return GetFileSystem().OpenFile(file, flags, GetOpener());
85289 }

◆ SupportsOpenFileExtended()

bool duckdb::OpenerFileSystem::SupportsOpenFileExtended ( ) const
inlineoverrideprotectedvirtual

Reimplemented from duckdb::FileSystem.

85291 {
85292 return true;
85293 }

◆ ListFilesExtended()

bool duckdb::OpenerFileSystem::ListFilesExtended ( const string & directory,
const std::function< void(OpenFileInfo &info)> & callback,
optional_ptr< FileOpener > opener )
inlineoverrideprotectedvirtual

Reimplemented from duckdb::FileSystem.

85296 {
85297 VerifyNoOpener(opener);
85298 VerifyCanAccessDirectory(directory);
85299 return GetFileSystem().ListFiles(directory, callback, GetOpener().get());
85300 }

◆ SupportsListFilesExtended()

bool duckdb::OpenerFileSystem::SupportsListFilesExtended ( ) const
inlineoverrideprotectedvirtual

Reimplemented from duckdb::FileSystem.

85302 {
85303 return true;
85304 }

◆ GlobFilesExtended()

unique_ptr< MultiFileList > duckdb::OpenerFileSystem::GlobFilesExtended ( const string & path,
const FileGlobInput & input,
optional_ptr< FileOpener > opener )
inlineoverrideprotectedvirtual

Reimplemented from duckdb::FileSystem.

85307 {
85308 VerifyNoOpener(opener);
85309 VerifyCanAccessFile(path);
85310 return GetFileSystem().Glob(path, input, GetOpener());
85311 }

◆ SupportsGlobExtended()

bool duckdb::OpenerFileSystem::SupportsGlobExtended ( ) const
inlineoverrideprotectedvirtual

Reimplemented from duckdb::FileSystem.

85313 {
85314 return true;
85315 }

◆ CanonicalizePath()

string duckdb::OpenerFileSystem::CanonicalizePath ( const string & path,
optional_ptr< FileOpener > opener = nullptr )
inlineoverrideprotectedvirtual

Canonicalize a path.

Reimplemented from duckdb::FileSystem.

85317 {
85318 VerifyNoOpener(opener);
85319 return GetFileSystem().CanonicalizePath(path_p, GetOpener());
85320 }

◆ VerifyCanAccessFileInternal()

void duckdb::OpenerFileSystem::VerifyCanAccessFileInternal ( const string & path,
FileType type )
private
85339 {
85340 auto opener = GetOpener();
85341 if (!opener) {
85342 return;
85343 }
85344 auto db = opener->TryGetDatabase();
85345 if (!db) {
85346 return;
85347 }
85348 auto &config = db->config;
85349 if (!config.CanAccessFile(path, type)) {
85350 throw PermissionException("Cannot access %s \"%s\" - file system operations are disabled by configuration",
85351 type == FileType::FILE_TYPE_DIR ? "directory" : "file", path);
85352 }
85353}
db

The documentation for this class was generated from the following file: