[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] deleting a line again



Not quite "any" file system, although I don't know of any exceptions at the
moment (I suspect there are some).  I didn't play with the "soups" of the
Newton:  did one remove a line from those "in place" in that context?

I've worked on machines which could write partial blocks on disk...on those
it was feasible to shorten one or more blocks to remove a line, without
rewriting the whole file.

Which doesn't change the fact that the way to do it in the modern context
we're talking about is to rewrite the file.

   --John  (who won't even mention the act of removing a card from a tray
of punched cards, or the act of punching DEL characters over a record in a
paper tape, both of which he has done to remove lines from files  ;-))

At 17:20 -0700 2/8/00, A K Suska wrote:
>No, it is not.  You will have to re-write the whole file.  This is a
>function of the file system (i.e., of any file system).  A file is nothing
>but a series of blocks of bytes--usually contiguous but depends on file
>system. Files are not made of lines, words, paragraphs, or anything of the
>kind. These are items only understood by humans. Perl can guess what a line
>is based on an assumption of a character that identifies the end of a line
>(i.e. line-break).
>
>-K
>
>"A foolish consistency is the hobgoblin of little minds"
>
>> From: george rosenberg <ghrose@unm.edu>
>> Date: Tue, 8 Feb 2000 15:36:13 -0800
>> To: macperl@macperl.org
>> Subject: [MacPerl] deleting a line again
>>
>>
>>
>> let me explain further, what I am probably trying to ask:
>> almost always, the line i want to remove is the first line in the
>> file and it begins with a ">".
>> i want to remove this line and then close the file.
>>
>> is it possible to do this? is there a delete line command, that will
>> remove the line and not leave a empty line behind?
>>
>> thanks
>>
>>
>>
>>>> i would like to use Macperl to remove a single line from a "big
>>>> bunch" of files without leaving a blank line behind.  is it possible
>>>> to do this without rewriting the whole file? is there a command or
>>>> short code that can do this once the line has been indentified?
>>>
>>> Sorry, no, that's not how file systems work (When I was young, even
>>> the concept
>>> of being able to jump to an arbitrary position in an open file was
>>> revolutionary :-)
>>>
>>> Matthias
>>>
>>> --
>>> Matthias Neeracher   <neeri@iis.ee.ethz.ch>
>>> http://www.iis.ee.ethz.ch/~neeri
>>> "And that's why I am going to turn this world upside down, and make
>>> of it a fire so *bright* that someone real will notice"
>>> -- Vernor Vinge, _Tatja Grimm's World_
>>
>> --
>>
>> # ===== Want to unsubscribe from this list?
>> # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org
>>
>
>
># ===== Want to unsubscribe from this list?
># ===== Send mail with body "unsubscribe" to macperl-request@macperl.org

-- 
John Baxter   jwblist@olympus.net      Port Ludlow, WA, USA

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org