Hi eveyrone,

I have been writing an script that detects licenses of files inside a
folder (using python)

using pseudo code is something like:

for file in folder:
    license = open_subprocess("nomossa " + file)  # creates and destroy a
process for every file

Now I am dealing with folder with thousands of files and I am trying to
reduce runtime, not creating a new process for each file, something like:

nomos = create_subprocess("nomossa")
for file in folder:
    license = nomos.input(file)
nomos.close()

See that a process is opened once and then use it in an interactive way.
This approach works with programs like cat, if you type cat on your
terminal it waits for input, but not nomos. It is possible in this moment
to do something similar, if not, is it feasible?

I know I can use another approach:

license = create_subprocess("nomossa" + a list of file)
# nomos file1 file2 file3

But because how my script is evolving I like to consider the option
explained above.

Thank you very much.
_______________________________________________
fossology mailing list
[email protected]
http://lists.fossology.org/mailman/listinfo/fossology

Reply via email to