Tuesday, 15 March 2011

delphi - File operations conflicts -



delphi - File operations conflicts -

i’m writing programme continously looking new files in directory. after extracts info each file , makes treatments it, files moved directory containing scanned files.

imagine i’m copying new file in scanned directory while programme running. can file has not finished copying treated (and produce unforeseen results), or locked scheme ?

now, imagine 2 instances of programme running on 2 different computers, continously scanning same folder. can happen if both instances trying move same file ?

thank help.

i have project much same thing. application receiving info feed , writing files folder. application processing files opening them, acting on them in way, writing them folder, deleting them.

the strategy used in application processing , deleting open them this:

tfilestream.create(afilename, fmopenread or fmsharedenywrite);

if file beingness opened still beingness written process, above fail, , can opened on subsequent iteration.

delphi pascal

No comments:

Post a Comment