Skip to content

File utils needed #1

@wisonye

Description

@wisonye

SmartFile is an opaque pointer to the following struct:

struct File {
    inner: FILE
}

The interface should look like this:

  • SMART_FILE macro to wrap FILE *, or just use MAKE_UNIQUE_PTR macro?

  • String FU_read_to_string(SmartFile file)

  • Vec FU_read_lines(SmartFile file)

  • usize FU_write_to_file(SmartFile file, u8 *bytes, usize len)

  • FU_append_to_file(SmartFile file, u8 *bytes, usize len)

  • FU_delete_file(SmartFile file)

  • FU_copy_file(SmartFile file, const char *new_filename)

  • FU_move_file(SmartFile file, const char *new_filename)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions