One way to get things done "properly" is to submit the file through
the server, then on the server you get it in exactly the same format
that all files are saved. You could maybe even arrange this to happen
automatically, using symlinks to the file from the published name to
the one that you submi
On Tue, Aug 31, 2010 at 2:14 PM, Matthias Felleisen
wrote:
>
> Would this help:
>
> ;; String (instance Text%) -> Void
> ;; load the content of file f into text editor t,
> ;; strip meta-data in first three lines
> (define (load f t)
> (send t load-file f)
> (define txt (send t get-text))
> (de
Ah. Well, I guess the right thing to do is to just chop the first
three lines out of the file. You should probably check for some
keyword in the header file to make sure that it really is the header
generated by drracket.
If the file contains images, then the three lines of header will be
encoded
p.s. In that case, just read and strip the first three lines. See 'load'.
On Aug 31, 2010, at 3:13 PM, Ryan Golbeck wrote:
> I'm modifying the handin-server collection to include an option where
> our students can retrieve "starter" files for assignments and labs.
> Since these files will be s
Would this help:
;; String (instance Text%) -> Void
;; load the content of file f into text editor t,
;; strip meta-data in first three lines
(define (load f t)
(send t load-file f)
(define txt (send t get-text))
(define inp (open-input-string txt))
(define fst (read-line inp))
(def
I'm modifying the handin-server collection to include an option where
our students can retrieve "starter" files for assignments and labs.
Since these files will be saved on the server directly from DrRacket,
rather than through the handin infrastructure, the files include these
three lines of meta
You have to specially remove those lines yourself in that case.
But if you say a little more about why you want to read something into
a text% object, I may give a different answer (it isn't clear what you
want to do with this stuff).
Robby
On Tue, Aug 31, 2010 at 1:49 PM, Ryan Golbeck wrote:
>
What's the proper way to read a file produced by DrRacket into a text% object?
Using load-file produces problems when DrRacket has created a file
where the first three lines contain meta data information about the
language to use.
Thanks,
-ryan
_
8 matches
Mail list logo