On Saturday, November 5, 2016 at 3:05:04 PM UTC-7, David K. Storrs wrote:
> I've got this little snip of code:  
> 
> 
> 
> 
> (define p "/tmp/foo/bar-28")
> 
> (file-exists? p)  ; #t
> (delete-file p)
> (file-exists? p)  ; still #t  ??
> 
> 
> I've verified that:
> 
> *) It's not throwing an exception
> *) The code is running as me
> *) The /tmp directory is 777  [I'm on OSX 10.11]
> *) The file itself is 666, although that shouldn't matter
> *) The file is owned by me
> 
> *) p is a string
> 
> *) p points to the correct file
> 
> *) There are no leading or trailing whitespace characters
> 
> *) If I run this code from inside a command-line Racket REPL, it works fine 
> and the file is deleted
> 
> *) If I replace (delete-file) with (system @~a{rm -f @p}) it works fine
> 
> I thought maybe there was something weird about the /tmp directory, so I 
> tried putting the target in a different directory 
> (/Users/dstorrs/tmp/foo/bar-28) but that made no difference.
> 
> I've tried googling on the general net and in the mailing list archives and 
> found nothing.  I am utterly flummoxed here; can anyone suggest anything?

After a LOT of work, I finally tracked this down:  delete-file was being 
overriden by a message from our network protocol, which was being included into 
my test code as a re-export from a different library.  I didn't find it at 
first because in the protocol file the message is 'delete_file' (with an 
underscore), but when murphy/protobuf compiles the .proto file into a .rkt file 
it changes all underscores to dashes.  I renamed the message to 'delete_a_file' 
and that fixed it.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to