From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85312 invoked by alias); 2 Sep 2015 15:03:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 85275 invoked by uid 89); 2 Sep 2015 15:03:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 02 Sep 2015 15:03:22 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id t82F3Jhu008051 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Sep 2015 08:03:19 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id t82F3HYa008050; Wed, 2 Sep 2015 08:03:17 -0700 (PDT) (envelope-from sgk) Date: Wed, 02 Sep 2015 15:03:00 -0000 From: Steve Kargl To: Janne Blomqvist Cc: Jerry DeLisle , Fortran List , GCC Patches Subject: Re: [Fortran, committed] XFAIL read_dir.f90 on FreeBSD Message-ID: <20150902150317.GA8007@troutmask.apl.washington.edu> References: <20150901181627.GA55465@troutmask.apl.washington.edu> <20150901181837.GA55508@troutmask.apl.washington.edu> <55E62694.5000207@charter.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-09/txt/msg00170.txt.bz2 On Wed, Sep 02, 2015 at 11:30:07AM +0300, Janne Blomqvist wrote: > On Wed, Sep 2, 2015 at 1:28 AM, Jerry DeLisle wrote: > > On 09/01/2015 11:18 AM, Steve Kargl wrote: > >> On Tue, Sep 01, 2015 at 11:16:27AM -0700, Steve Kargl wrote: > >>> open(unit=10, file='junko.dir',iostat=ios,action='read',access='stream') > >>> if (ios.ne.0) call abort > >>> read(10, iostat=ios) c > >>> - if (ios.ne.21) call abort > >>> + if (ios.ne.21) then > >>> + close(10) > >> > >> I forgot to mention that 'close(10, status="delete')' does not > >> work on a directory. Should it? > >> > >>> + call system('rmdir junko.dir') > >>> + call abort > >>> + end if > >>> + close(10) > >>> call system('rmdir junko.dir') > >> > > > > Thanks for the touch up Steve. I suspect other OS's will not work either. I > > assumed close with Status="delete" would not work on a directory. > > That's because libgfortran uses unlink(2), which only works for files, > not directories. One could change that to use remove(3), which works > for both. I suspect people who create directories and then want to delete them will use SYSTEM or the standard conforming equivalent. > Also, I suspect the reason why it fails on freebsd is that errno > EISDIR is not 21 there. Perhaps one should just check for ios /= 0? I checked. FreeBSD's EISDIR is 21; howevr, ios == 0 in this case. I haven't looked too deep. FreeBSD is probably adhering to the unix philosophy of "everything is a file". -- Steve