[racket-dev] overwrite

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Feb 27 14:42:52 EST 2011

Yes, that's it. Also, put something into the after-save-file-method:

diff --git a/collects/framework/private/editor.rkt
b/collects/framework/private/editor.rkt
index 0c8981b..cb5504a 100644
--- a/collects/framework/private/editor.rkt
+++ b/collects/framework/private/editor.rkt
@@ -190,7 +190,8 @@
             (set! last-saved-file-time
                   (and filename
                        (file-exists? filename)
-                       (file-or-directory-modify-seconds filename)))))
+                       (file-or-directory-modify-seconds filename))
+            (log-warning (format "saved ~a at ~a" filename
last-saved-file-time)))))

         (inner (void) after-save-file success?))

and then when you see this strange behavior, maybe it the particular
numbers that you're seeing might shed some light on which part of this
is going wrong.

Thanks!

Robby

On Sun, Feb 27, 2011 at 12:08 PM, John Clements
<clements at brinckerhoff.org> wrote:
>
> On Feb 26, 2011, at 9:26 AM, Kathy Gray wrote:
>
>> Same answers.
>> -Kathy
>
> +1
>
> I've seen this for ~ 6 months; I believe I've reported it before, but never followed up on it adequately. At least one of my students has also seen it.
>
> To add a few details: It usually happens on a "run", asking if I want to revert the file.  The message occurs on every subsequent run, until I save. When I save, DrRacket indicates that the file has changed on disk, and do I want to overwrite (yes). Then things are fine again.
>
> Is this the kind of annotation you were thinking of?
>
> oiseau:~/plt/collects/framework clements$ git diff private/editor.rkt
> diff --git a/collects/framework/private/editor.rkt b/collects/framework/private/editor.rkt
> index 0c8981b..9f21ce6 100644
> --- a/collects/framework/private/editor.rkt
> +++ b/collects/framework/private/editor.rkt
> @@ -209,6 +209,9 @@
>                (and fn
>                     (file-exists? fn)
>                     (let ([ms (file-or-directory-modify-seconds fn)])
> +                      (when (< last-saved-file-time ms)
> +                        (log-warning (format "last-saved-file-time: ~v" last-saved-file-time))
> +                        (log-warning (format "file-modified-time: ~v" ms)))
>                       (< last-saved-file-time ms))))))
>
>       (define has-focus #f)
> oiseau:~/plt/collects/framework clements$
>
>
> Looking at this code, I'm betting on Neil's suggestion of NTP, though I realize that the mechanism isn't obvious... perhaps the OS adjusts the save times of recently-saved files?
>
>
> John Clements
>
>
>
>>
>> On 26 Feb 2011, at 5:23:56, Matthias Felleisen wrote:
>>
>>>
>>> On Feb 26, 2011, at 12:12 PM, Robby Findler wrote:
>>>
>>>> Are any of you, by any chance:
>>>>
>>>> - using a teaching language (via the language menu, not #lang
>>>> 2htdp/bsl or similar)
>>>
>>> #lang racket
>>>
>>>
>>>> - hitting run and then save right *after* run
>>>
>>> no
>>>
>>>
>>>>
>>>> when you get this message?
>>>>
>>>> Robby
>>>>
>>>> On Sat, Feb 26, 2011 at 11:10 AM, Nadeem Abdul Hamid <nadeem at acm.org> wrote:
>>>>> I get this a lot, using just the binary installer version downloaded
>>>>> from racket-lang.org. And it happens even when I'm not using
>>>>> check-syntax, though it might happen more frequently when I do use
>>>>> check-syntax; hard to tell.
>>>>>
>>>>>
>>>>>
>>>>> On Sat, Feb 26, 2011 at 12:05 PM, Matthias Felleisen
>>>>> <matthias at ccs.neu.edu> wrote:
>>>>>>
>>>>>> Well it just occurred for a file under Git but WITHOUT check syntax.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Feb 26, 2011, at 11:48 AM, Matthias Felleisen wrote:
>>>>>>
>>>>>>>
>>>>>>> I confirm the check syntax observation.
>>>>>>>
>>>>>>> On Feb 26, 2011, at 11:39 AM, Kathy Gray wrote:
>>>>>>>
>>>>>>>> I also see this quite frequently (for files not under Git control). I was thinking at one point it might be related to when I run check syntax, but I haven't confirmed a repeatable pattern.
>>>>>>>>
>>>>>>>> -Kathy
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On 26 Feb 2011, at 4:36:37, Matthias Felleisen wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> The files I have been editing this morning are not under Git control.
>>>>>>>>> (And yes, I have on one occasion checked the file via Emacs and didn't
>>>>>>>>> see any difference.)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Feb 26, 2011, at 11:35 AM, Jay McCarthy wrote:
>>>>>>>>>
>>>>>>>>>> It's from git touching the files and giving them a new timestamp. It
>>>>>>>>>> probably didn't really change.
>>>>>>>>>>
>>>>>>>>>> Jay
>>>>>>>>>>
>>>>>>>>>> 2011/2/26 Matthias Felleisen <matthias at ccs.neu.edu>:
>>>>>>>>>>>
>>>>>>>>>>> When I use drracket, I frequently get a warning that my file has been modified on disk and the question of whether I want to save the file or revert. Is anyone else suffering from this problem?
>>>>>>>>>>> _________________________________________________
>>>>>>>>>>> For list-related administrative tasks:
>>>>>>>>>>> http://lists.racket-lang.org/listinfo/dev
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Jay McCarthy <jay at cs.byu.edu>
>>>>>>>>>> Assistant Professor / Brigham Young University
>>>>>>>>>> http://faculty.cs.byu.edu/~jay
>>>>>>>>>>
>>>>>>>>>> "The glory of God is Intelligence" - D&C 93
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _________________________________________________
>>>>>>>>> For list-related administrative tasks:
>>>>>>>>> http://lists.racket-lang.org/listinfo/dev
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _________________________________________________
>>>>>>> For list-related administrative tasks:
>>>>>>> http://lists.racket-lang.org/listinfo/dev
>>>>>>
>>>>>>
>>>>>> _________________________________________________
>>>>>> For list-related administrative tasks:
>>>>>> http://lists.racket-lang.org/listinfo/dev
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Nadeem Abdul Hamid
>>>>> Associate Professor, Computer Science
>>>>> Berry College
>>>>> PO Box 5014
>>>>> 2277 Martha Berry Hwy NW
>>>>> Mount Berry, GA 30149-5014
>>>>> (706) 368-5632
>>>>> http://cs.berry.edu/~nhamid/
>>>>>
>>>>> _________________________________________________
>>>>> For list-related administrative tasks:
>>>>> http://lists.racket-lang.org/listinfo/dev
>>>>>
>>>
>>>
>>> _________________________________________________
>>> For list-related administrative tasks:
>>> http://lists.racket-lang.org/listinfo/dev
>>
>>
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://lists.racket-lang.org/listinfo/dev
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>



Posted on the dev mailing list.