I have a program which, in short, needs to take a directory of files and write, into a file, the meta data and content of each file. The second step is to recover the directory from the file.
I am unable to think of a way to separate the meta-data in the file so that it can be extracted easily under any circumstance. This is mainly because Linux allows almost every character to be used to name a directory or file (except for / or \0). Therefore any other character could just be part of the name of a file or part of its content.
EXAMPLE of shortened file entry:
dir_name/sub_directory/file_name[separator]9999[separator]1234[separator]content
Any ideas would be greatly appreciated.