[{"id":25651,"web_url":"https://patchwork.libcamera.org/comment/25651/","msgid":"<166695297775.3974115.11128768039124666988@Monstersaurus>","date":"2022-10-28T10:29:37","subject":"Re: [libcamera-devel] [PATCH v5 05/10] android: remove references\n\tto std::filesystem","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Nicholas Roth via libcamera-devel (2022-10-28 04:17:21)\n> From: Nicholas Roth <nicholas@rothemail.net>\n> \n> Android 11's toolchain does not support std::filesystem, but\n> camera_hal_config.cpp currently uses it. Remove references to\n> std::filesystem in order to support Android <= 11.\n> \n> This adds a very small difference in behaviour, as File::exist() will\n> return true for special files (pipes, character or block devices, ...)\n> while std::filesystem::is_regular_file() doesn't, but I consider this\n> to be a corner case that doesn't matter much.\n> \n> Signed-off-by: Nicholas Roth <nicholas@rothemail.net>\n\nFrom Jacopo on an earlier version:\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nAnd from me:\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/android/camera_hal_config.cpp | 9 ++++-----\n>  1 file changed, 4 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp\n> index bacfe4b9..0e7cde63 100644\n> --- a/src/android/camera_hal_config.cpp\n> +++ b/src/android/camera_hal_config.cpp\n> @@ -6,7 +6,6 @@\n>   */\n>  #include \"camera_hal_config.h\"\n>  \n> -#include <filesystem>\n>  #include <stdlib.h>\n>  #include <string>\n>  \n> @@ -160,15 +159,15 @@ CameraHalConfig::CameraHalConfig()\n>   */\n>  int CameraHalConfig::parseConfigurationFile()\n>  {\n> -       std::filesystem::path filePath = LIBCAMERA_SYSCONF_DIR;\n> -       filePath /= \"camera_hal.yaml\";\n> -       if (!std::filesystem::is_regular_file(filePath)) {\n> +       std::string filePath = LIBCAMERA_SYSCONF_DIR \"/camera_hal.yaml\";\n> +\n> +       File file(filePath);\n> +       if (!file.exists()) {\n>                 LOG(HALConfig, Debug)\n>                         << \"Configuration file: \\\"\" << filePath << \"\\\" not found\";\n>                 return -ENOENT;\n>         }\n>  \n> -       File file(filePath);\n>         if (!file.open(File::OpenModeFlag::ReadOnly)) {\n>                 int ret = file.error();\n>                 LOG(HALConfig, Error) << \"Failed to open configuration file \"\n> -- \n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1FB38BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Oct 2022 10:29:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A091A61F4A;\n\tFri, 28 Oct 2022 12:29:42 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DA08361F4A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Oct 2022 12:29:40 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 633BE6BE;\n\tFri, 28 Oct 2022 12:29:40 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666952982;\n\tbh=RxjvGsg7tlfjEZEtM20qWRflDTwTjBiy/GsX7jdsm2k=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=2JelIaxWvIVtoKzPa69kqX3p8/4EKpYpzSadyzARe/qK4ptP4r3uHZ//LDW79QRbZ\n\tcjWEkESszhtXGWqiDPq7Nnr3Z8iwR5wOUR/6YZy/aBrKuUy3+O0ZxPajv4EULDHp2Z\n\tW6s1FAIq9bIGu8A7bX8GHbEWGIHxGRgjWLZbTukkJkyKqI71cZ4oTYdvcbAFwXf4lH\n\tmtfoHinq05OZLrV8B96QW/elUNuaaGc6N8Vf7/Fu+uT/4cTUX0skzXcuH1qY42FV5s\n\tgdZtK360rl/6WWNEpzxvFIxEVT/26/SVydv+rdPYkPK7dgj4sCcLRHTYZ9Zn9hhoZJ\n\tt3fsEHkj2M00A==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1666952980;\n\tbh=RxjvGsg7tlfjEZEtM20qWRflDTwTjBiy/GsX7jdsm2k=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=hkiD+0b1MeEM/KA/wCSkErffGB8XcK1rxjEMwcqIU8srCpn8AqcGSKksDD6eTAQFc\n\t1tKyo9UtnD6Jwtf2XDD30qM+0/uMQ/4yfSPSVlMWpr9KIgggHMndedaoNuHufFoauI\n\tyS2wDy00DYveEKf2oedNF1KcK2CmnMq7UY7Li96g="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"hkiD+0b1\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20221028031726.4849-6-nicholas@rothemail.net>","References":"<20221027224135.348115-1-nicholas@rothemail.net>\n\t<20221028031726.4849-1-nicholas@rothemail.net>\n\t<20221028031726.4849-6-nicholas@rothemail.net>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 28 Oct 2022 11:29:37 +0100","Message-ID":"<166695297775.3974115.11128768039124666988@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v5 05/10] android: remove references\n\tto std::filesystem","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"nicholas@rothemail.net","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]