in reply to System call on MSDos

This is offtopic for perl, but file redirects work in DOS. Therefore, date /t > outfile.txt would output it to outfile.txt in the same directory. You can give it a path to go where you'd like.

Just another way that you can get the job done...    --jay

Replies are listed 'Best First'.
Re: Re: System call on MSDos
by VSarkiss (Monsignor) on Feb 27, 2002 at 20:52 UTC

    Aack! Stuff like this is fraught with peril. Don't do it!

    What if the user had a valuable file of the same name in that directory that you just clobbered? What if you don't have permission to write in the directory? What if someone in a different timezone has mounted the drive remotely and runs at the same time as you do? What if any of a number of ugly things happen between the time you write it and the time you read it?

    This creates a maintenance headache way out of proportion to the problem you're trying to solve. Polluting a directory to get the date is completely unnecessary, and is an accident just waiting to happen.

    But now let me tell you how I really feel ;-)

Re: Re: System call on MSDos
by fenners (Beadle) on Feb 27, 2002 at 23:36 UTC
    You're right of course about redirecting the output. But, sorry to nitpick, this isn't DOS exactly - it's the WinNT shell. DOS, as seen on Windows9x/3x/MS-DOS won't take the switch /t after the date command.