Diff/compare two files by file descriptor (fd) instead of file name
问题 Is there any way in Linux, using c, to generate a diff/patch of two files stored in memory, using a common format (ie: unified diff, like with the command-line diff utility)? I'm working on a system where I generate two text files in memory, and no external storage is available, or desired. I need to create a line-by-line diff of the two files, and since they are mmap 'ed, they don't have file names, preventing me from simply calling system("diff file1.txt file2.txt") . I have file