why
問題兒童
总版主
发贴: 4629
积分: 388
|
于 2005-12-30 22:54
Java doesn't have such methods, nor do most, if not all, programming languages, provide such Random Access File "delete" functionality. Correct me if this's wrong.
Think about or check this: does the other APIs in java.io provide such a delete feature? Nope. No matter you 受不了 or not.
具体的说,是循环拷贝这个文件的内容(跳过这一行)。但是这种方法不好,比如文件很大呢? Of coruse, this is not "efficient" but what else can one do? One could only minimize the number of writes, perhaps by making use of buffer or cache, or certain complex structures (formats) if it is not plain text file.
Do a Google search for ways to do this "delete".
BTW, I asked you 為甚麼要用RandomAccessFile呢? Did you think about it?
why edited on 2005-12-31 03:37
|