Scotty C wrote on 01/26/2016 12:39 AM:
i know that i can do this in a linux terminal window with the following: cat mytmp*.dat >> myoriginal.dat. i'd like to accomplish this from within the program by shelling out. can't figure it out. other methodologies that are super fast will be entertained. thanks, scott
If the files are huge, doing it with `/bin/cat`, called via the Racket `system*` procedure, seems like a fast and reasonable way, though Racket's `copy-port` procedure might be efficient enough for this particular program. (I use external processes with Racket like this sometimes, especially in servers, when there are concurrent threads that need to be responsive. Just use external processes judiciously, when one knows the performance tradeoffs, not as a crutch, because they can make the system more fragile in a few different ways.) Remember to check the process exit status, and handle any error.
If your Racket program doesn't already have a list of the files to concatenate, and you want to do "filename globbing" like you do in the Linux shell, then you can use the `directory-list` procedure to get a list of files in a directory, and run them through `regexp-match?`.
Neil V. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.