X-Authentication-Warning: new-smtp1.ihug.com.au: Host p46-tnt4.syd.ihug.com.au [203.173.134.46] claimed to be acceleron Message-ID: <017401c11e7a$b3493f90$0a02a8c0@acceleron> From: "Andrew Cottrell" To: "Andrew Cottrell" , "Eli Zaretskii" , "Charles Sandmann" Cc: Subject: Re: Windows 2000 /dev/null permission query Date: Mon, 6 Aug 2001 23:21:26 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Reply-To: djgpp-workers AT delorie DOT com > > > > > Conclusion - LFN support in W2K is breaking things (like truncate, > > > utime, get_dev_info). Handles opened with the LFN calls are not being > > > treated the same as those opened with the old DOS APIs. > > > > Does function 7160/CL=01 (get short 8+3 name for a long file name) > > work reliably on W2K? If so, we could selectively modify functions > > like utime that open files and get trouble on W2K, to convert the long > > name to a short name and then use non-LFN functions to open the file. > > Only on W2K/XP, of course. > Added a highly modified version of _truename in to my touch example and only > called the new function. Under Win2K the call worked on my two examples. The > test and output was: > > DJGPP_204 D:\dj204\contrib\touch>dir ac*.txt > 06/08/2001 10:31p 22 acnewfilename.txt > 06/08/2001 10:39p 8 acnewfilename2.txt > > DJGPP_204 D:\dj204\contrib\touch>touch > True name of acnewfilename.txt is D:\dj204\contrib\touch\ACNEWF~1.TXT > True name of acnewfilename2.txt is D:\dj204\contrib\touch\ACNEWF~2.TXT > > DJGPP_204 D:\dj204\contrib\touch>dir acnewf~1.txt > 06/08/2001 10:31p 22 acnewfilename.txt > > DJGPP_204 D:\dj204\contrib\touch>dir acnewf~2.txt > 06/08/2001 10:39p 8 acnewfilename2.txt > > The function also worked fine on Win98. > > We could also do this universally (on W2K/XP), in all functions that > > open files, but for that we will have first to see if opening a file > > with a legacy DOS function disables some LFN features when we pass a > > handle from a non-LFN open. For example, do functions 5704 and 5705 > > work on a handle open by a non-LFN DOS call? Checked the code and it looked so easy to test so.... If in _open.c I use the SFN code ah = 0x3d, al = oflag or the 0x6C00 call then touch updates the time with the 5701 DPMI int and the int86 call. 5704 / 5705 and 5706/5707 appear to work with the mod in _open, but I need to check the files properties to ensure that they work. I need to double check tomorrow night to ensure I have not made any mistakes and add extra debugging to make the test easier to check. > > Another idea might be to use `dup' to duplicate a handle from an LFN > > open call, then see if that handle has the same problems with function > > 5701 as the original handle. (Since `dup' doesn't have an LFN analog, > > maybe the duplicated handle is created as a non-LFN one, who knows?) > Not tested. Tomorrow