In class IDiskRemote, all metadata file system operations use os file system api directly.
There is little extendiability if we want store the metadata of HDFS or S3 into distributed file system.
So I suggest change this way by using DiskPtr and will propose a pull request.

In addition, metadata of HDFS or S3 only store local FS which is not sharable.

const String & remote_fs_root_path_,
        const String & disk_path_,
        const String & metadata_file_path_,
        bool create)
    : RemoteMetadata(remote_fs_root_path_, metadata_file_path_)
    , disk_path(disk_path_)
    , total_size(0), ref_count(0)
{
    if (create)
        return;
    try
    {
        ReadBufferFromFile buf(disk_path + metadata_file_path, 1024); 
        UInt32 version;
        readIntText(version, buf);
        if (version < VERSION_ABSOLUTE_PATHS || version > VERSION_READ_ONLY_FLAG)
            throw Exception(
                ErrorCodes::UNKNOWN_FORMAT,
                "Unknown metadata file version. Path: {}. Version: {}. Maximum expected version: {}",
                disk_path + metadata_file_path, toString(version), toString(VERSION_READ_ONLY_FLAG));
        assertChar('\n', buf);
        UInt32 remote_fs_objects_count;
        readIntText(remote_fs_objects_count, buf);
        assertChar('\t', buf);
        readIntText(total_size, buf);
        assertChar('\n', buf);
        remote_fs_objects.resize(remote_fs_objects_count);
        for (size_t i = 0; i < remote_fs_objects_count; ++i)
        {
            String remote_fs_object_path;