Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNbBR-0004Td-0K for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Apr 2020 11:53:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jNbBP-0005h1-DS for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Apr 2020 11:53:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNbBP-0005gu-6W for pgsql-hackers@lists.postgresql.org; Sun, 12 Apr 2020 11:53:51 +0000 Received: from courriel-2.mines-paristech.fr ([77.158.173.19] helo=antispam-1.ensmp.fr) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNbBJ-0001R1-AP for pgsql-hackers@postgresql.org; Sun, 12 Apr 2020 11:53:50 +0000 Received: from smtp-4.mines-paristech.fr (smtp-4.ensmp.fr [77.158.173.143]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by antispam-1.ensmp.fr (antispam.mines-paristech.fr) with ESMTPS id 14A2955DF0; Sun, 12 Apr 2020 13:53:43 +0200 (CEST) Received: from pseudo (108.237.219.88.rev.sfr.net [88.219.237.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-4.mines-paristech.fr (Postfix) with ESMTPSA id B35CE2C0057; Sun, 12 Apr 2020 13:53:41 +0200 (CEST) Date: Sun, 12 Apr 2020 13:53:40 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@pseudo To: Justin Pryzby cc: Alvaro Herrera , David Steele , pgsql-hackers@postgresql.org, "Bossart, Nathan" , Thomas Munro , Tom Lane Subject: Re: pg_ls_tmpdir to show directories and shared filesets (and pg_ls_*) In-Reply-To: <20200331200812.GI14618@telsasoft.com> Message-ID: References: <20200316214806.GQ26184@telsasoft.com> <20200316221736.GA15635@alvherre.pgsql> <20200317031427.GU26184@telsasoft.com> <20200317190401.GY26184@telsasoft.com> <20200331200812.GI14618@telsasoft.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgeduhedrvdejgdeghecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffujgfkfhgfgggtsehttdertddtredvnecuhfhrohhmpefhrggsihgvnhcuvefqgffnjffquceotghovghlhhhosegtrhhirdgvnhhsmhhprdhfrheqnecukfhppeekkedrvdduledrvdefjedruddtkeenucfrrghrrghmpehmohguvgepshhmthhpohhuth X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Justin, About v15, seen as one patch. Patches serie applies cleanly, compiles, "make check" ok. Documentation: - indent documentation text around 80 cols, as done around? - indent SQL example for readability and capitalize keywords (pg_ls_dir_metadata) - "For each file in a directory, list the file and its metadata." maybe: "List files and their metadata in a directory"? Code: - Most pg_ls_*dir* functions call pg_ls_dir_files(), which looks like reasonable refactoring, ISTM that the code is actually smaller. - please follow pg style, eg not "} else {" - there is a "XXX" (meaning fixme?) tag remaining in a comment. - file types: why not do block & character devices, fifo and socket as well, before the unkown case? - I'm wondering whether could pg_stat_file call pg_ls_dir_files without too much effort? ISTM that the output structure nearly the same. I do not like much having one function specialized for files and one for directories. Tests: - good, there are some! - indent SQL code, eg by starting a new line on new clauses? - put comments on separate lines (I'm not against it on principle, I do that, but I do not think that it is done much in test files). -- Fabien.