SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    May 2001
    Location
    Rochester, NY, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Force file/directory refresh

    I am creating a text file and then immediately performing a file comparison to a previous version of the same file. I export the contents of a table to a text and then use:

    SYS_VerifyText(sBaseFilePath, sCurrFilePath)

    to perform a file comparison. This works great for small files but I am running into a problem with 376K file. Sometimes the newly created file is not complete in the difference viewer (only about 2/3 of the contents are displayed). Other times the difference viewer is invoked but both versions of the text file are complete and there really are no differences displayed.

    It seems as though the difference viewer is executing before the file export is completed. If I insert a Sleep(10) it works fine, but that is no solution.

    Any help would be appreciated, Thanks

    ------------------
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

  2. #2
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Force file/directory refresh

    Maybe you could set up some kind of loop which checks the last modified date of the file, and if it has changed from the last time round the loop, waits a second before trying again. That way your loop would exit when the last modified date of the file has stopped changing, i.e. when the file is complete.
    This assumes that your file is being appended to pretty much constantly, rather than in discrete (>1s apart) batches, but apart from that should work fine.

    ------------------

  3. #3
    Member
    Join Date
    May 2001
    Location
    Rochester, NY, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Force file/directory refresh

    I tried looping and checking both the last modified datetime value and also the file size value using SYS_GetDirContents, neither one worked. I thought I might have a shot with the file size value because you can see it incrementing sometimes when exporting a large file.

    It seems like both of those values are already done updating by the time I start looping to check the values. But for some reason SYS_VerifyText still sees the files as being different and invokes the difference viewer, but once the viewer is opened the text files are identical. An annoying little problem.

    Any other ideas would be appreciated, thanks.

    ------------------
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Force file/directory refresh

    So, if Verify shows the files as being identical, it is not an issue of comparing the files before the export is complete.

    At this point I'd probably construct a routine that got a handle to each file, opened them and walked them line by line doing a comparison.

    I feel like a broken record with statements like this, but I tend to not trust much of the built in functionality of the tool; stuff like default base state, Verify routines... Don't get me wrong. I love this tool, but I just want as much control of what is happening as I can get.

    If you walk those files line by line with a statement like while FileReadLine(), you have that sort of control. You can report your results at the end, or report for each line. It's your call.



    ------------------

  5. #5
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Force file/directory refresh

    I agree totally with DJGrey. The idea behind the Verify commands is well intentioned but since you don't know what's going on under the covers and you're given very little control over it, you're frequently much better off if you provide your own solution.

    And relying on a "they didn't match" indication isn't going to be nearly as useful as knowing exactly what didn't match when it comes time to report the error to a developer.


    John


    ------------------


    [This message has been edited by John J. Miller (edited 08-16-2002).]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:45 PM.

Copyright BetaSoft Inc.