Re: File in use, Catch/Try a number of times

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Do you have to worry about backup issues after midnight?


"Mark Rae [MVP]" <mark@xxxxxxxxxxxxxxxxx> wrote in message
news:OLjuhCGVIHA.1208@xxxxxxxxxxxxxxxxxxxxxxx
"Larry Bud" <larrybud2002@xxxxxxxxx> wrote in message
news:de404a49-866e-4b4e-bb36-ad8a311e72e4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

How would you recommend this interaction to occur so the web service
doesn't step on the toes of the processing app and vice versa?

Firstly, the absolute last thing I'd do is have a text file on a web
server which can potentially be locked by more than one user - seems like
a disaster waiting to happen...

Instead, every time a client does an upload, I'd create a separate file
with a dynamically created filename - I'd almost certainly construct the
filename based on a combination of the client's unique identifier and a
timestamp e.g. 123-20080111144130.xml or 20080111144130-123.xml. That way
you wouldn't need to worry about file locking or overwriting...

Then I'd set my processing app to run at just after midnight, and design
it so that it polled the folder containing the XML file(s), inspecting the
filename so that it processed only the files where the timetamp portion of
the filename was earlier than the current day, deleting / renaming them
after successful processing...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net


.



Relevant Pages

  • Re: File in use, Catch/Try a number of times
    ... doesn't step on the toes of the processing app and vice versa? ... the absolute last thing I'd do is have a text file on a web server which can potentially be locked by more than one user - seems like a disaster waiting to happen... ... Instead, every time a client does an upload, I'd create a separate file with a dynamically created filename - I'd almost certainly construct the filename based on a combination of the client's unique identifier and a timestamp e.g. 123-20080111144130.xml or 20080111144130-123.xml. ... Then I'd set my processing app to run at just after midnight, and design it so that it polled the folder containing the XML file, inspecting the filename so that it processed only the files where the timetamp portion of the filename was earlier than the current day, deleting / renaming them after successful processing... ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: File in use, Catch/Try a number of times
    ... the absolute last thing I'd do is have a text file on a web server ... a dynamically created filename - I'd almost certainly construct the filename ... Then I'd set my processing app to run at just after midnight, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: configurable variables in own file?
    ... I do not worry about an end user injecting code. ... and the filename ... For standard cases, this should work fine. ... The rest of the configuration are just variables, ...
    (comp.lang.perl.misc)
  • Re: File in use, Catch/Try a number of times
    ... then after its closed rename to.xml. ... then the pickup prograg will ... a dynamically created filename - I'd almost certainly construct the filename ... Then I'd set my processing app to run at just after midnight, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How do I keep other users from saving my read-only document?
    ... >Go into Windows Explorer and find your filename in the appropriate folder. ... >(Don't worry about them changing it when they open it - if they can't save ... >the changes, it doesn't matter! ... worksheet. ...
    (microsoft.public.excel.misc)