Re: Writing to beginning of file

2002-03-11 Thread Johannes Franken
On Sat, Mar 09, 2002 at 11:36:08PM -0800, Troy May wrote: > How do you write to the beginning of a file? That's an easy one: Just turn the file around, and append to its end. # cat > regular first second third ^D # mkfifo backwards # while : ; do tac regular > backwards; done & [1] 18464 # cat b

Re: Writing to beginning of file

2002-03-10 Thread Elaine -HFB- Ashton
Troy May [[EMAIL PROTECTED]] quoth: *>Hello, *> *>How do you write to the beginning of a file? I see only 3 options to open a *>file: to read, to overwrite, and to append to the end of the file. *> *>I tried seeking to the beginning before the write, but it doesn't work. *>Seek must only work fo

Re: Writing to beginning of file

2002-03-10 Thread John W. Krahn
Troy May wrote: > > Hello, Hello, > How do you write to the beginning of a file? I see only 3 options to open a > file: to read, to overwrite, and to append to the end of the file. > > I tried seeking to the beginning before the write, but it doesn't work. > Seek must only work for a read. >

Re: Writing to beginning of file

2002-03-10 Thread Jon Molin
Troy May wrote: > > Hello, > > How do you write to the beginning of a file? I see only 3 options to open a > file: to read, to overwrite, and to append to the end of the file. > If you think about the file as an array with one char on each index: my @string = split (/|/, "this is a test"); n

RE: Writing to beginning of file

2002-03-09 Thread Timothy Johnson
--Original Message- From: Troy May To: Perl Beginners Sent: 3/9/02 11:36 PM Subject: Writing to beginning of file Hello, How do you write to the beginning of a file? I see only 3 options to open a file: to read, to overwrite, and to append to the end of the file. I tried seeking to the beginn

Writing to beginning of file

2002-03-09 Thread Troy May
Hello, How do you write to the beginning of a file? I see only 3 options to open a file: to read, to overwrite, and to append to the end of the file. I tried seeking to the beginning before the write, but it doesn't work. Seek must only work for a read. Any ideas? -- To unsubscribe, e-mail