On 2006-08-21, Alex Martelli <[EMAIL PROTECTED]> wrote:
> Grant Edwards <[EMAIL PROTECTED]> wrote:
>...
>> IIRC, ctrl-Z is not used _in_files_ to represent EOF. Only
>> when text is being entered at the console.
>
> Easy to test, if you have Windows:
I might, but I won't admit it in public. :
Alex Martelli wrote:
>> IIRC, ctrl-Z is not used _in_files_ to represent EOF. Only
>> when text is being entered at the console.
>
> Easy to test, if you have Windows:
>
n='foo.txt'
s='ba\r\n'+chr(26)+'bo\r\r'
open(n,'wb').write(s)
ss=open(n).read()
ss
> 'ba\n'
>
> As
Grant Edwards <[EMAIL PROTECTED]> wrote:
...
> IIRC, ctrl-Z is not used _in_files_ to represent EOF. Only
> when text is being entered at the console.
Easy to test, if you have Windows:
>>> n='foo.txt'
>>> s='ba\r\n'+chr(26)+'bo\r\r'
>>> open(n,'wb').write(s)
>>> ss=open(n).read()
>>> ss
'ba\
On 2006-08-19, Tim Chase <[EMAIL PROTECTED]> wrote:
>>> can i write a eof to a file descriptor without closing it?
>>
>> No. Not on Windows, OS-X, or Unix. There is no such thing as
>> "an eof".
>>
>> On CP/M Ctrl-Z is used as EOF for text files.
>
> Common Dos/Window convention also uses ctrl+
cage wrote:
> I want to use a program that has a 'pipe' mode, in which you can use
> stdin to send commands to the program. I found out that, when in pipe
> mode and you are using the keyboard as input source you can do Ctrl-D to
> 'signal' the program that you have finished typing your command
cage wrote:
> hello
>
> can i write a eof to a file descriptor without closing it?
> like:
> fd.write(EOF)
> or something
>
> grts,
> ruben
No but there is an EOF to the file anyway, even if it is open.
I recall under MS-DOS, you could create a file of size N without writing to
it (some INT21
Actually, nevermind. It appears that receiving an EOF from a stream
tells it when to stop 'reading', not necessarily that the stream is
closed. What a weird behavior.
--
http://mail.python.org/mailman/listinfo/python-list
Writing the binary value for ^D into the stream will not do anything.
That value signals the shell to close the stream, as such it only has
significance when you're typing something into the shell.
To the OP: writing an EOF to a stream without closing it makes no
sense. EOF means just that--end of
cage schrieb:
> Marc 'BlackJack' Rintsch schreef:
>> In <[EMAIL PROTECTED]>, cage wrote:
>>
>>> can i write a eof to a file descriptor without closing it?
>>> like:
>>> fd.write(EOF)
>>> or something
>>
>> What do you expect this to to? Writing a byte to the file and you don't
>> know which va
cage wrote:
> I want to use a program that has a 'pipe' mode, in which you can use
> stdin to send commands to the program. I found out that, when in pipe
> mode and you are using the keyboard as input source you can do Ctrl-D to
> 'signal' the program that you have finished typing your command.
>> can i write a eof to a file descriptor without closing it?
>
> No. Not on Windows, OS-X, or Unix. There is no such thing as
> "an eof".
>
> On CP/M Ctrl-Z is used as EOF for text files.
Common Dos/Window convention also uses ctrl+Z (0x1a) for EOF.
c:\> copy con test.txt
hel
Marc 'BlackJack' Rintsch schreef:
> In <[EMAIL PROTECTED]>, cage wrote:
>
>> can i write a eof to a file descriptor without closing it?
>> like:
>> fd.write(EOF)
>> or something
>
> What do you expect this to to? Writing a byte to the file and you don't
> know which value this byte has?
>
On 2006-08-19, cage <[EMAIL PROTECTED]> wrote:
> can i write a eof to a file descriptor without closing it?
No. Not on Windows, OS-X, or Unix. There is no such thing as
"an eof".
On CP/M Ctrl-Z is used as EOF for text files.
--
Grant Edwards
[EMAIL PROTECTED]
--
http://mail.python.org/mail
In <[EMAIL PROTECTED]>, cage wrote:
> can i write a eof to a file descriptor without closing it?
> like:
> fd.write(EOF)
> or something
What do you expect this to to? Writing a byte to the file and you don't
know which value this byte has?
Ciao,
Marc 'BlackJack' Rintsch
--
http:/
hello
can i write a eof to a file descriptor without closing it?
like:
fd.write(EOF)
or something
grts,
ruben
--
http://mail.python.org/mailman/listinfo/python-list
15 matches
Mail list logo