From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71732: 30.0.50; [FR] xdg: provide an ability to create XDG directory, if it does not exist Date: Sun, 23 Jun 2024 13:12:42 +0300 Message-ID: <86v820dl2d.fsf@gnu.org> References: <87pls8uhcu.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3965"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bjorn.bidar@thaodan.de, 71732@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 23 12:13:33 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sLKE0-0000qd-5O for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Jun 2024 12:13:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLKDX-0005VY-CR; Sun, 23 Jun 2024 06:13:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLKDV-0005VH-Q9 for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2024 06:13:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLKDV-0008VU-GZ for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2024 06:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLKDV-0001zR-MU for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2024 06:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2024 10:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71732 X-GNU-PR-Package: emacs Original-Received: via spool by 71732-submit@debbugs.gnu.org id=B71732.17191375757635 (code B ref 71732); Sun, 23 Jun 2024 10:13:01 +0000 Original-Received: (at 71732) by debbugs.gnu.org; 23 Jun 2024 10:12:55 +0000 Original-Received: from localhost ([127.0.0.1]:52731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLKDP-0001z5-EQ for submit@debbugs.gnu.org; Sun, 23 Jun 2024 06:12:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLKDM-0001ym-79 for 71732@debbugs.gnu.org; Sun, 23 Jun 2024 06:12:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLKDG-0008Tf-EW; Sun, 23 Jun 2024 06:12:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=1l+qIRecF4kuv1yBhpXOTOn2Rpq9L9OP32RnbtNEPNU=; b=niLzRz7l+smUE2BTNpLB kv+JtsCmgD/dVMFKwqyuJ8jb7R5guKjbECTmCQaK6lm3OxdRrrggq4n2NF037HpEC/GOg9Foe4U/N 69D+I1hPmHXOCKS9njx50bRJSPAmU8TZLJGyw+6alVviYRoMIMxDb/POEZ4vWEJ6xMA9NMjWc45BB 5KQCXIni9lMMPoD+gNGNxSRApeUiBjJ0TVtyNQnSLOyie5l7lDuE6rGi/OTzaNvQKr9PO2KdbqmYD eEFroZNtTr9wnQVDaepbdGuLz3AL7+GTC6H31kr53yEEcDNkEXJjuWroWCaqDfxjApE1LxH3x7Y+L qq9GMbVWr/vFXQ==; In-Reply-To: <87pls8uhcu.fsf@localhost> (message from Ihor Radchenko on Sun, 23 Jun 2024 09:40:49 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287771 Archived-At: > Cc: Eli Zaretskii , Björn Bidar > From: Ihor Radchenko > Date: Sun, 23 Jun 2024 09:40:49 +0000 > > Currently `xdg-cache-home`, and other functions in xdg.el only return > the path, but never create any directories. Yes, because whether or not to create a missing directory is up to the calling application. For example, if the application is looking for a file in several possible locations, then a missing directory means that particular location doesn't have the file, and the application should look in the other places. > However, to follow XDG spec, XDG directories must follow certain > rules. In particular: > > If, when attempting to write a file, the destination directory is > non-existent an attempt should be made to create it with permission > 0700. If the destination directory exists already the permissions > should not be changed. > https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html > > May you please add a functionality to xdg.el to create the directory > with right permissions, so that xdg.el users do not need to know these > technical details of the spec? xdg.el is not about creating directories, it is about returning their names. The ability to create a directory with arbitrary permissions already exists, and Emacs uses that in umpteen places. So I'm not sure what is missing here. Not every two-liner needs a dedicated named API.