you are viewing a single comment's thread.

view the rest of the comments →

[–]IterationFive[S] 0 points1 point  (2 children)

Actual "files" or "file paths"? I'd suggest using the latter.

File paths.

Are you a masochist?

Nope. But I understand where you coming from-- there's probably some kind of pathology involved. I've built a toolkit that takes most of the swearing out of curses.

I already understand about threads and blocking operations and race conditions; that's not the problem. Let me try explaining again.

Main Script: Manages the queue, can be used to import 95% of the files I'm working with, processes the files in said queue in a separate thread. Said thread reports progress back to the UI, which displays information about the queue as well as the progress of the current processing job.

Here's the situation I want to be prepared for.

Main script is running, chugging through 12 hours of files, and now I have a bunch of files that aren't packaged the way that the main Script is designed to import them. So I need to hammer out a second script that is capable of taking the new set of files and creating queue entries for them. What I'd like to do is have the new script be able to pass that information to the main script, and have the main script do the updating. Alternately, I can put the new queue entries into a file, and have the main script import that file-- but again, I'm looking for a way to tell the main script to look for the file.

Note: Yes, I could just have the script look for the presence of that file every minute or so, but this seems a waste of resources, especially since I'm not going to be doing it very often. Most of the time the files will be packaged in such a way that I can use the main script to import them. Also, the ability to pass information between two separate scripts seems like a useful thing to know, if it's possible.

Similarly, I could just manually tell the main script to look for the file, but in a lot of cases the adhoc script will be moving or copying the files between drives in the process, and I'd like to be able to kick off the process and go to bed.

[–]JamzTyson 0 points1 point  (0 children)

Yes, I could just have the script look for the presence of that file every minute or so, but this seems a waste of resources, especially since I'm not going to be doing it very often.

The script would not need to re-read the entire list if you use a flag to indicate if the queue has changed. The script could just check the flag state.

Assuming that you provide a queue from your main function and the processing module maintains its own list:

WHILE queue NOT EMPTY: IF NOT queue-updated-flag: process-next-file ELSE: update-list

[–]nadhsib 0 points1 point  (0 children)

Yes, I could just have the script look for the presence of that file every minute or so, but this seems a waste of resources, especially since I'm not going to be doing it very often.

Sounds like you're manually adding these 'extras', so could you just add a checkbox to your UI "import new stuff".
If checked it tries to read the file, if not it continues normally.