+def get_dat_file_size(bbs, board, thread):
+ """Returns size of dat file"""
+ dat_path = misc.get_thread_dat_path(bbs, board, thread)
+ if not os.path.exists(dat_path):
+ return 0
+
+ return os.path.getsize(dat_path)
+
+def get_dat_line_count(bbs, board, thread):
+ """Returns the number of line of a dat file specified by bbs, board
+ and thread
+
+ bbs: bbs id
+
+ board: board id
+
+ thread: thread id
+ """
+ dat_path = misc.get_thread_dat_path(bbs, board, thread)
+ if not os.path.exists(dat_path):
+ return 0
+
+ f = fileinput.FileInput(dat_path)
+ for l in f: -1
+ return f.filelineno()
+