Shop OBEX P1 Docs P2 Docs Learn Events
SXKey IDE prompting on file version — Parallax Forums

SXKey IDE prompting on file version

DunnseptDunnsept Posts: 115
edited 2006-04-28 11:43 in General Discussion
I've been working with an SX/B program which I have stored on a flash drive.· I have 2 files open in the IDE and when I switch between them
or if I alt-tab from the IDE to another program and then back to the IDE it (about 80% of the time) will prompt me that a new version of the
file exists on the drive, do I want to load the newer version from disk. It also has done this to me when compiling, programming and when running SXSim. I do not have explorer open, nor does any other program have files open on that drive.
It will do this even right after I click SAVE (or save->compile or save->program)
No other programs have modified that file and since I just saved it, the version on disk·is the latest, but it still prompts me that a newer
version is available on disk.

any ideas? I've looked at the date/time stamp on the file and don't see any huge difference or discrepancy that would explain it.

paul...

Comments

  • BeanBean Posts: 8,129
    edited 2006-04-25 16:21
    Paul,
    That happens to me sometimes too. You cannot get back to IDE unless you reload the file.
    I haven't figured out why it happens either.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012


    "SX-Video OSD module"·available·for only·$49.95·www.sxvm.com
    Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • RsadeikaRsadeika Posts: 3,837
    edited 2006-04-25 16:27
    "... do I want to load the newer version from disk." I also noticed the same ?problem?, I am not sure what to make of it. It does get a liitle confusing, like, OK what file am I really working with. I did not post because I thought that it was my fault, I did something weird, again. So, you are not the only one that this has occured to.

    Ray
  • PJMontyPJMonty Posts: 983
    edited 2006-04-26 10:37
    What version of the IDE are you guys running?
      Thanks, PeterM
  • RsadeikaRsadeika Posts: 3,837
    edited 2006-04-26 12:17
    IDE ver 3.10, that is what it shows in the about. I downloaded and installed SetupSXKeyEditor-v3.1r2.

    <Edit: I am not using a USB·flash, just the standard setup.>

    Ray

    Post Edited (Rsadeika) : 4/26/2006 1:22:34 PM GMT
  • BeanBean Posts: 8,129
    edited 2006-04-26 12:51
    PeterM,
    I'm using 3.10 also.
    I should note that my files are on a USB flash drive also. Maybe there is something funny about the way they work (timestamp?) that is confusing the IDE.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012


    "SX-Video OSD module"·available·for only·$49.95·www.sxvm.com
    Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • DunnseptDunnsept Posts: 115
    edited 2006-04-26 18:48
    At first I was thinking about the time stamp, and also if the file had been modified in the editor without saving. But a couple times
    today after having saved the file and not having modified it either, I got prompted if I wanted to load the newer version from disk. In the IDE file list, there was no asterix next to the file name either. I had a few times when I saved the file and all I had to do was switch back and forth between the 2 open files in the IDE and each time it would prompt me about the newer file.
    (I too have 3.1)
  • PJMontyPJMonty Posts: 983
    edited 2006-04-27 07:57
    Yeah, it's definitely a USB drive issue. I haven't looked into the code yet, but I believe it has something to do either with Windows doing lazy writes to the disk, or perhaps some internal caching by the USB drive. It happens if you save a file, switch away and then come back.

    Here's what I believe is going on:

    I think that when the file is saved, the IDE gets the timestamp from the OS right after the save. The problem is that the info has not actually been written to the disk but is either cached somewhere or pending completion in the USB drive. The result is that the timestamp it receives and stores internally is actually the timestamp of the original file which didn't get overwritten yet. Meanwhile, you work happily and at some point switch to another program. When you come back, the IDE gets the timestamp from the OS (which is now accurate and reflects the time of the completed write), compares it to the bogus value returned earlier by the OS, and can only conclude that there is a new version on disk.

    I'll see what is going on and try and get it fixed.
      hanks, PeterM
  • DunnseptDunnsept Posts: 115
    edited 2006-04-27 15:52
    PeterM:

    just checked my USB drive.. I have it set for "optimize for quick removal" which turns write cacheing off. It is also USB 2.0 so shouldn't be too slow or anything, especially with the relatively small file sizes. If there's something I can do to help you test this, let me know.
    putting my code on an USB drive is really handy since I work on this stuff during lunch and on breaks and I can then easily take the stuff home with me.

    Paul...
  • BeanBean Posts: 8,129
    edited 2006-04-27 16:24
    PeterM,
    Same for me. Let me know if there is anything to want tested.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com


    COMING SOON "SD DATA LOGGER" www.sddatalogger.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • PJMontyPJMonty Posts: 983
    edited 2006-04-28 08:29
    FIXED! I now force the file stream buffer to flush before reading the timestamp. On hard drives, no forced flush was necessary, but on the flash drives (which have considerably slower write speeds) apparently the flush is needed.

    I appreciate this being brought to my attention so I could address it. I also appreciate the key detail that made the fix easy to locate which was that the files were being written to a USB flash drive. In bug reports, the more details given, the easier it is to find. If no one had mentioned that detail, I would have tested it on my hard drive and reported that I was unable to replicate the bug.

    When CCS, Parallax and I get all the C compiler issues sorted and release a new version of the IDE (we're working on it!) this bug fix will come along for the ride.
      Thanks, PeterM
  • BeanBean Posts: 8,129
    edited 2006-04-28 11:19
    THANK YOU...

    Not to seem ungrateful, but has the problem with WATCHing bit variables been fixed ? If I remember right it works if the bit is in position 0, but it doesn't if it's in position 1-7.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com


    COMING SOON "SD DATA LOGGER" www.sddatalogger.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • PJMontyPJMonty Posts: 983
    edited 2006-04-28 11:43
    Bean,

    I can't remember off the top of ym head. I believe I fixed it in my internal version, but I have to verify this to be sure.
      Thanks, PeterM
Sign In or Register to comment.