delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/16/23:34:12

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10108170329.AA12403@clio.rice.edu>
Subject: Win2K : what about _creat* ?
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Thu, 16 Aug 2001 22:29:09 -0500 (CDT)
Cc: djgpp-workers AT delorie DOT com (DJGPP developers), acottrel AT ihug DOT com DOT au
In-Reply-To: <Pine.SUN.3.91.1010816141659.12766D-100000@is> from "Eli Zaretskii" at Aug 16, 2001 02:20:15 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Let's assume _open() works ok ... 

We still have the problems with _creat and _creatnew

My proposal for this mess is something like this:

  __dpmi_int(0x21, &r);
  if(r.x.flags & 1)
  {
    errno = __doserr_to_errno(r.x.ax);
    return -1;
  }
+ if(_osmajor == 5 && _USE_LFN && _dos_get_version(1) == 0x532)
+ {
+   _close(r.x.ax);
+   return _open(filename, 2);
+ }
  __file_handle_set(r.x.ax, O_BINARY);
  return r.x.ax;
}

If we are ready to return, the file is created with the right 
attributes and ready to write.  We close it, open it (now as a
SFN open so _chmod will work).

Thoughts?  5 lines of code for each one, and it puts all the work on
the _open already written.  (For creatnew may want to OR flags with 2).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019