From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6570B40E0A for ; Tue, 10 May 2022 21:23:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E33A468B379; Wed, 11 May 2022 00:22:58 +0300 (EEST) Received: from msg-6.mailo.com (ip-16.mailobj.net [213.182.54.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 358DF6801C8 for ; Wed, 11 May 2022 00:22:52 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1652217771; bh=u//5kTdDUyzbk52ro/AX+gHkc7WXFAB2aGjBSSiNyfE=; h=X-EA-Auth:From:To:Date:Subject:MIME-Version:X-Mailer:Message-ID: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=HOW1jwNUaytxyleqnjcNSiY6YA7vK9vhrx4DdBvSOqHKKgw6BDT15AkB6aZqUfP1g u9HppiFeATsJUvEZlWyxMsQHY5XSPzL2j0NOCvV112MVzN8KIYL7pnd2olabi5RnKH tcSsMTfF8Aszu4kmwTMaai6KM7sNWcGHyllmR1KA= Received: by www-7.mailo.com with http webmail; Tue, 10 May 2022 23:22:51 +0200 (CEST) X-EA-Auth: hpljpRwks6k+ab4E5PXMSK3EouftLHNaBah3g27xsU+iqxt+miOadB1jgJI4YPztxcAvlES7XJ1zCQYO/V87uNGRNyQVfPtu From: nil-admirari@mailo.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 10 May 2022 23:22:51 +0200 (CEST) X-Priority: 3 MIME-Version: 1.0 X-Mailer: COMS/EA21.01/r20220415 Message-ID: In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v11 1/6] libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and utf8toansi X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > Paths are strings. In other languages, paths are represented with classes, e.g. std::filesystem::path in C++ or pathlib.Path in Python. In C classes have to be emulated with structs and functions. Even plain strings would've been OK to represent paths, if there was a set of functions everyone uses for path operations, but there is none. Which brings us to your second question. > It needs to be found out why it was added to decide in which way it > can be adjusted. Backward to forward slash adjustment is there from the very beginning: https://github.com/FFmpeg/FFmpeg/commit/1b30e4f5865260323da5232174fc68d6cc283f45. Apparently it's needed for path concatenation, which is implemented with snprintf, whose pattern uses / as a separator even on Windows: https://github.com/FFmpeg/FFmpeg/blame/master/fftools/cmdutils.c#L843. Now back to classes. If there was a Path class, you could've changed the constructor and the path concat operation to normalise the path and prepend it with \\?\ when it exceeds MAX_PATH, which is what you want me to do. Two places only (maybe some more), and the entire application becomes long-path aware. But there is no Path class. Instead there are 587 occurrences of snprintf, each of which potentially does path concat. snprintf is not alone, strcat and the likes can also be used for path concat. These hundreds of places have to be examined and potentially changed to prepend \\?\. And a couple dozen of places will surely be missed in the process. And all that is touted as being somehow better than changing a single manifest. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".