Hi everyone,
it has taken me a while to finally go through the process of sharing one small library I made and use in many of our projects in order to simplify file handling.
Attached please find my very own Library “FileHelper” (creative name, isn’t it? )
I made it and use it for simplified file content reading and writing from and to a buffer.
It encapsulates the calls for opening, reading, writing, creating, linking… whatever is needed to achieve the goal.
It comes as-is with no guarantees and/or support (although I am monitoring this thread and will possibly also reply ) or anything else attached to it - you download it, you use it.
It’s released with sources so you can see what it does inside. It’s not much but it has saved quite a few instances of basically the same code in various projects.
I will also possibly enhance the documentation in the future, currently it’s quite basic - sorry for that.
FB ReadFileContent
ReadFileContent_options_typ
Member | Description | Default |
---|---|---|
DeleteFileAfterRead | Delete the file after reading it | FALSE |
ReadOffset | Offset to start the reading from | 0 |
IgnoreSizeAboveDataSize | If the file size is bigger than the given buffer, should the extra amount of data be ignored? (if FALSE, an error is generated) | FALSE |
FB WriteFileContent
WriteFileContent_options_typ
Member | Description | Default |
---|---|---|
OverwriteOnExist | TRUE → File is overwritten if already existing; FALSE → Error when file already exists | TRUE |
TruncateFile | TRUE → Existing file will be shortened to WriteOffset + given DataSize (see fiTruncate on FileWriteEx) | TRUE |
WriteOffset | Offset inside the file to start the writing from | 0 |
FileDevice | Parameters for the FileDevice |
I am looking forward to your feedback.
Download it here:
FileHelper.zip (5.4 KB)