Message-ID: <38305AFA.F17C62CA@softhome.net> Date: Mon, 15 Nov 1999 21:11:54 +0200 From: Laurynas Biveinis X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: lt,en MIME-Version: 1.0 To: Eli Zaretskii CC: djgpp-workers AT delorie DOT com Subject: Re: First alpha symlink patch References: Content-Type: text/plain; charset=iso-8859-4 Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Eli Zaretskii wrote: > `ftw' recursively descends a directory tree, applying a user-defined > function to each file. What happens if you pass it a user-defined > function that, if the file is a directory, chdirs to that directory and > prints what getcwd returns? Just for fun, make it chdir by calling > __dpmi_in directly. OK, tried it with chdir(), tried with my own chdir() through __dpmi_int() - everything works. Of course, if I use __dpmi_int(), I have to resolve symlinks by hand, and getwd() returns real directory instead. > > BTW, how could DOS store `current directory' itself? IMHO in global > > variable. > DOS can do it because it is itself the server of the chdir call. Our > libc isn't, so it isn't simple for it to keep track of cwd. Yes, but I try to determine, when I can and when I cannot keep track of current dir: in chdir() I remember real directory name as well as symlink, and in getwd() I always make a DOS call and compare results with real directory name. Only if they match, I return symlink. IMHO this way should work. Laurynas Biveinis