Re: bugs at iter file() ?

From: Wolfgang Strobl (news2_at_mystrobl.de)
Date: 08/07/04


Date: Sat, 07 Aug 2004 12:36:08 +0200


"Terry Reedy" <tjreedy@udel.edu>:

>"Michael Geary" <Mike@Geary.com> wrote in message
>news:10fc6kj98mkfef4@corp.supernews.com...
>> Terry Reedy wrote:
>> > To add to what Tim said: From the viewpoint of Windows in
>> > its default mode, there are no remaining lines. ^Z is the end
>> > of file and anything after that is accidental junk filling out the
>> > remainder of the disk block.
>>
>> Just to clarify one point... Windows itself does not have "text" or "binary"
>> files, and it does not treat ^Z in a file in any special way. There are no
>> special characters in files.

>Sorry, but ^Z has meant end-of-file I presume from the first version of
>DOS, which I suspect copied the usage from something previous.

Sorry, but Michael got it right. Windows itself does not have 'text' or
'binary' files or open modes. Have a look at CreateFile in the Platform
SDK. You won't find anythink like _TEXT or _BINARY there.

^Z is a carryover from CP/M to DOS, which, like crlf<->lf translation,
got some support in various libraries, for obvious reasons. It's not
part of the Win32 API.

>Example
>(Microsoft Basic manual, 1989): "When input is redirected [from terminal to
>a file], GW Basic continues to read from this source until a CTRL-Z is
>detected."

So what? BASICA is an application, just like bash or sendmail.

>Perhaps the usage has dimmed in non-DOS-based Windows, so that
>I should have said more carefully "from the viewpoint of DOS and perhaps
>DOS-based Windows and partially in modern non-DOS-based Windows ...".
>Still, in Windows XP, open a Command Prompt window and enter
>
>disk:\path> copy con: temp
>abd^Zdef
>
>where ^Z is control-Z and you get a file with 3, not 7 characters.
>
>The Windows version of the Python interactive interpreter exits on ^Z
>because that is, or at least was, standard behavior for interactive non-gui
>DOS/Windows programs

You mean like terminating a program using a single dot on a line is, or
at least was, standard behaviour for interactive non-gui UNIX/Linux
applications? :-)

-- 
Thank you for observing all safety precautions


Relevant Pages

  • Re: Linux syscalls
    ... > A device driver or a rewrite of DOS could permit this, ... really "DOS inside Windows" or "Windows inside DOS"? ... > DOS interrupts are revectored... ... if you re-write DOS to use the _Windows device drivers_ ...
    (alt.lang.asm)
  • [Full-Disclosure] ron1n phone home, episode 4
    ... Hacking from Windows 3.x, 95 and NT ... Use secret Windows 95 DOS commands to track down and port surf computers ... Download hacker tools such as port scanners and password crackers designed ... Now you have the option of eight TCP/IP utilities to play with: telnet, ...
    (Full-Disclosure)
  • Re: MS and security: good effort but no cigar
    ... And last but not least, no fat, no dos, no multiboot. ... build upon the progress it's already made in security. ... a Windows system, it is still surprisingly easy to completely own that ... Then there's the issue of poorly secured server applications. ...
    (microsoft.public.windowsxp.general)
  • Re: assembly language and reverse engineering
    ... in Windows assembly programming what you can't learn when doing ... Windows API but about assembly programming). ... And you have far less to learn to get your first working DOS program than ... but, real mode is real mode, and pmode is pmode. ...
    (alt.lang.asm)
  • Re: Gamma Function
    ... the destructive Windows critter-makers who are ... Windows runs DOS programs ... DOS isn't a multi-tasking operating system. ... The virus itself is but a code fragment that attaches ...
    (sci.physics.relativity)