Skip to content

No output file from Kismet database with no rows #14

@ajmeese7

Description

@ajmeese7

Whenever I run kismet_log_to_pcap --in my_rowless_file.kismet --out output.pcap, the output file is not actually created.

This is likely currently intentional, but I'm not sure that is the right default behavior to have. This was causing issues in my script where I was trying to read data from a file I expected to exist, even if the file was just empty. I've implemented a workaround for the time being, but I really think a solution like this should be the library's default:

filename = await self.convert_kismet_to_pcap(kismet_in=filename)
with open(csv_filename) as read_obj:
    extra_info_kismet_df = pd.read_csv(read_obj, low_memory=False, delimiter='\t')

# Handle cases where there is no generated file (because the Kismet file has no rows)
if not os.path.isfile(filename):
    with open(filename, "w") as empty_file:
        empty_file.write("")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions