RE: Duplicated files program

new topic     » goto parent     » topic index » view thread      » older message » newer message

If there are more than one DOS window, each one has its current dir,
independently of the others. So, under DOS, there is no problem.
I admit I don't know what Windows does when issuing system("D:", 2)
(apparently nothing), but in
any case, in a DOS windows, it applies only to the issuing window, not
others nor to
DOS as a whole.
However, assume you have a test.bat file in drive C:, reading:
D:
cd \
dir > xx
and the current directory of D: is D:\GAMES
Then, if you execute system("test", 2), D:\xx will contain the root
directory of D:, but afterwards the current directory will be the original
from C:, and the current directory of D: will be the same as before.
----- Original Message -----
From: Juergen Luethje <jluethje at gmx.de>
To: EUforum <EUforum at topica.com>
Sent: Wednesday, July 24, 2002 9:59 AM
Subject: Re: Duplicated files program


>
> Ricardo <rforno at tutopia.com> wrote:
>
> <snip>
> > Each drive under DOS/Windows has at any time its current dir.
>
> This applies to DOS. Are you sure, that it applies to Windows, too?
> After reading
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/dirr
ef_6g6x.asp
> I _assume_, on Windows there is only one current directory.
>
> > If I issue:
> > i = chdir("D:\\GAMES"), I am changing the current dir of D: (a thing I
don't
> > want to do) and, moreover, current_dir() still returns the current dir
of
> > C:, for example C:\ZZ.
> > If, instead, I write:
> > i = chdir("D:"), nothing happens.
> > What I want to know is the current dir of a drive different from the one
I
> > am executing my program. This works with system() under ex, but not
under
> > exw.
>
> system() starts a new DOS shell. For example, using system("D:", 2) sets
> the current drive to D: _on DOS_.
> When you call system("D:", 2) from a Windows program, I _assume_ that
> Windows simply doesn't know what has happened on DOS.
>
> > Please have a look to my NEWDUP.EXW program that I sent earlier.
> > Regards.
> <snip>
>
> Another consideration concerning current_dir():
> What happens, when another program changes the current directory, while
> your program is running?
>
> Regards,
>    Juergen
>
>
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu