Il 20/04/2011 22:24, Frank Morgner ha scritto: > But all other functions of libopensc require the caller to allocate > enough space. Vital for maintainable software: who needs memory, allocates (*and frees*) it. As a sage said a long time ago: "or you rewrite your project this way, or your project will rewrite you" :)
> In the third solution the caller still allocates memory. He then > sequentially calls sc_read_binary with more and more space allocated. He > stops when the first error is thrown. What about allocating 'x' (32?) KB then reads the whole file? > The problem I have is to read a file with an unknown length. How is that possible? Aren't file sizes fixed at file creation time? Have I missed something? IIUC, when you issue a SELECT_FILE, you can see its size, too. I'm confused. BYtE, Diego. _______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel