Sign in to follow this  
Followers 0
SpookMeister

Program design Q

4 posts in this topic

Hey guys,

I'm looking for input on a program design issue I am facing.

I want to create a program that, in the course of its functions, pulls random words from a list of around 10k words.

This program will be run by multiple users from a network share, perhaps at the same time, so file locking issues may come into play.

Currently I have the list of words in a simple .txt file, one per line. I'm toying with other options here and want some more experienced opinions on how best to avoid file locking and other multi-user issues.

- Should I try to stick them into a database instead of the flat file?

- Should I have the program read the file into a huge array?

- - or perhaps just hard code the words into the program as they are going to be static information anyway?

- Should I just leave them in the flat file and develop some sort of way to incorporate error handling around the brief file locking issues?

Any thoughts?

-Spook


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

This program will be run by multiple users from a network share, perhaps at the same time, so file locking issues may come into play.

why do you think, file locking comes into play? I don't think that AutoIT does a lock on a file when it reads it! So, no problem....

A database is a bit overkill, if you just need a flat list of words....

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

I use something similar to this in my Hangman Game (see my signature).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0