DataSet.WriteXML

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott McNair

    DataSet.WriteXML

    I have an app that a tiny xml file for each transaction. These files are
    put in a pick-up folder for another app which takes the xml files out of
    the pick-up folder and processes them.

    My question is a simple (and perhaps stupid) one: when DataSet.WriteXM L
    executes, does it (A) write the XML file in a temp folder and then transfer
    it to my target, or (B) write the XML file directly to the target?

    My reason for asking is because I don't want to run into a situation where
    my polling app is trying to pick up a file that my main app is in the
    middle of writing.
  • sloan

    #2
    Re: DataSet.WriteXM L


    This is probably a hack...but I'll mention it.

    You could write the file as
    "file_0001111.t xt"
    and then after it finishes writing out..
    rename it to
    "file_0001111.x ml"

    and then only poll for .xml

    Maybe someone else can offer a better solution.

    ...

    My guess is that a rename is faster then a write.


    Have you had trouble, or just anticipating trouble?





    "Scott McNair" <smcnair@beache xpress.takethis partout.comwrot e in message
    news:Xns9A5A98B ED5CC8donquixot e235gmailco@207 .46.248.16...
    >I have an app that a tiny xml file for each transaction. These files are
    put in a pick-up folder for another app which takes the xml files out of
    the pick-up folder and processes them.
    >
    My question is a simple (and perhaps stupid) one: when DataSet.WriteXM L
    executes, does it (A) write the XML file in a temp folder and then
    transfer
    it to my target, or (B) write the XML file directly to the target?
    >
    My reason for asking is because I don't want to run into a situation where
    my polling app is trying to pick up a file that my main app is in the
    middle of writing.

    Comment

    • Rich P

      #3
      Re: DataSet.WriteXM L

      One more thing you could do is to write the xml file as xml but it will
      have one name during the writing. After the main app has completed
      writing the xml file, then rename it to something that the target app
      would look for. If you write it as text, you won't have the xml tags.
      So I would stay with the xml write. And another thing as long as you
      are always picking up an xml file with the same name each time is to
      check the create date of the file on the target app. This will help
      prevent picking up the same file multiple times (unless you are already
      deleting the file after you pick it up). Either way, it is always a
      good practice to check the create date when picking up the same named
      file.

      Rich

      *** Sent via Developersdex http://www.developersdex.com ***

      Comment

      Working...