Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 86148 invoked by uid 500); 2 Feb 2002 06:12:36 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 86136 invoked from network); 2 Feb 2002 06:12:36 -0000 Date: 2 Feb 2002 06:12:35 -0000 Message-ID: <20020202061235.30349.qmail@icarus.apache.org> From: bjh@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/file_io/os2 copy.c Makefile.in filestat.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bjh 02/02/01 22:12:35 Modified: file_io/os2 Makefile.in filestat.c Added: file_io/os2 copy.c Log: OS/2: Implement apr_file_attrs_set() & other minor build fixes for the addition of apr_file_copy() & friends. Revision Changes Path 1.23 +2 -1 apr/file_io/os2/Makefile.in Index: Makefile.in =================================================================== RCS file: /home/cvs/apr/file_io/os2/Makefile.in,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- Makefile.in 30 Sep 2001 08:13:51 -0000 1.22 +++ Makefile.in 2 Feb 2002 06:12:34 -0000 1.23 @@ -13,7 +13,8 @@ fullrw.lo \ filepath.lo \ filesys.lo \ - mktemp.lo + mktemp.lo \ + copy.lo # bring in rules.mk for standard functionality @INCLUDE_RULES@ 1.26 +26 -0 apr/file_io/os2/filestat.c Index: filestat.c =================================================================== RCS file: /home/cvs/apr/file_io/os2/filestat.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- filestat.c 28 Dec 2001 22:28:16 -0000 1.25 +++ filestat.c 2 Feb 2002 06:12:34 -0000 1.26 @@ -197,3 +197,29 @@ { return apr_stat(finfo, fname, wanted, cont); } + + + +APR_DECLARE(apr_status_t) apr_file_attrs_set(const char *fname, + apr_fileattrs_t attributes, + apr_pool_t *cont) +{ + FILESTATUS3 fs3; + ULONG rc = DosQueryPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3)); + + if (rc == 0) { + ULONG old_attr = fs3.attrFile; + + if (attributes & APR_FILE_ATTR_READONLY) { + fs3.attrFile |= FILE_READONLY; + } else { + fs3.attrFile &= ~FILE_READONLY; + } + + if (fs3.attrFile != old_attr) { + rc = DosSetPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3), 0); + } + } + + return APR_FROM_OS_ERROR(rc); +} 1.1 apr/file_io/os2/copy.c Index: copy.c =================================================================== #include "../unix/copy.c"