简体   繁体   English

什么是.lck文件,为什么不能用缓冲读取器读取它?

[英]What is a .lck file and why can't I read it with a buffered reader?

I'm trying to use crawler4j to crawl websites. 我正在尝试使用crawler4j来爬网网站。 I was able to follow the instructions on the crawler4j website. 我能够按照crawler4j网站上的说明进行操作。 When it is done it creates a folder with two different .lck files, one .jdb file and one .info.0 file. 完成后,它将创建一个包含两个不同的.lck文件,一个.jdb文件和一个.info.0文件的文件夹。

I tried to read in the file using the code that I provided in this answer to read in the file but it keeps failing. 我试图使用我在答案中提供的代码读取文件,以读取文件,但是它始终失败。 I've used the same function to read text files before, so I know the code works. 我之前使用过相同的功能来读取文本文件,所以我知道代码可以工作。

I also found someone else that asked the same question a few months ago. 我还发现几个月前有人问了同样的问题。 They never got an answer. 他们从来没有得到答案。

Why can't I use my code to open and read these .lck files to memory? 为什么我不能使用我的代码打开这些.lck文件并将其读取到内存中?

Crawler4j uses BerkeleyDB to store crawl informations. Crawler4j使用BerkeleyDB来存储爬网信息。 See here in the source. 请参见源代码中的此处。

From the command line you can use DB utils to acces the data. 在命令行中,您可以使用DB utils访问数据。 Already covered in SO here . 这里已经包含在SO中。

If you want to access the data in your Java code, you simply import BerkeleyDB library (Maven instruction there) and follow the tutorial on how to open the DB . 如果要访问Java代码中的数据,只需导入BerkeleyDB库(那里的Maven指令),然后按照有关如何打开DB教程进行操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM