Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) [Re:wukw]
why

問題兒童

总版主


发贴: 4629
积分: 388
于 2005-12-30 22:54 user profilesend a private message to usersend email to whysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
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.Smile

具体的说,是循环拷贝这个文件的内容(跳过这一行)。但是这种方法不好,比如文件很大呢?
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


话题树型展开
人气 标题 作者 字数 发贴时间
10233 问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) wukw 123 2005-12-30 20:18
7934 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) why 97 2005-12-30 20:48
8247 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) wukw 49 2005-12-30 21:39
7905 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) why 116 2005-12-30 21:55
8046 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) wukw 121 2005-12-30 22:37
7994 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) why 701 2005-12-30 22:54
8151 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) wukw 263 2005-12-31 03:12
7842 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) why 291 2005-12-31 03:51
7800 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) 空心菜 20 2006-01-05 22:34
7931 Re:问个弱智问题,java对文本文件的操作(RandomAccessFile没有delete()函数?) why 80 2006-01-05 23:19

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923