Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Preserve spaces in filenames

 [1/7] from: tmoeller:fastmail:fm at: 16-Feb-2006 13:59


Hi, i have a file containing a list of files with their full qualified path. the filenames contain spaces. i now need to extract the filenames construct a new path, fill the files with new content and write them to disk. in priciple this works well, but for some reason the files with spaces are not written. any suggestions?? Cheers Thorsten -- http://www.fastmail.fm - Access your email from home and the web

 [2/7] from: SunandaDH:aol at: 16-Feb-2006 8:21


Thorsten:
> any suggestions??
Is your extract routine truncating the file names at the first space? That's an easy slip-up to make when using parse. Do you have an example of the full file name you are trying to write? Sunanda.

 [3/7] from: tmoeller:fastmail:fm at: 16-Feb-2006 16:17


Hi Sunanda, thanks for your hint. i found out what happened. some filenames exist in various folders. so, putting them in one (wrere the they were overwritten) causes the impression, some files are missing. as there are lots of files it first seemed the ones with the spaces were the missing ones. now i found out that they were correctly written to disk. thanks again Thorsten On Thu, 16 Feb 2006 08:21:54 EST, SunandaDH-aol.com said:
> Thorsten: > > any suggestions??
<<quoted lines omitted: 6>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
------ Thorsten Moeller Schwalbenweg 5a 22453 Hamburg Fon: 040 / 589 17 980 Mobil: 0171 / 490 33 59 Mail: tmoeller-fastmail.fm -- http://www.fastmail.fm - Same, same, but different=85

 [4/7] from: Paavo:Nevalainen:saunalahti:fi at: 16-Feb-2006 17:23


At 02:59 PM 2/16/2006, Thorsten Moeller wrote:
>i have a file containing a list of files with their full qualified path. >the filenames contain spaces. i now need to extract the filenames >construct a new path, fill the files with new content and write them to >disk. in priciple this works well, but for some reason the files with >spaces are not written.
Should you use to-file to-file "/c/memory hogging/app/needs_mem.txt".

 [5/7] from: Paavo:Nevalainen:saunalahti:fi at: 16-Feb-2006 17:56


I have two questions: 1) How archives work on this list? I found archived messages from 2004 only. 2) How to draw a line between two movable faces. I need it to implement a simple graph editing functionality. A modified example from the RT docs: print "Drag these faces" make-face: function [ txt [string!] pos [pair!] ][ t ][ return make object! [ parents: make block! [] children: make block! [] fc: make face [ offset: pos size: do [layout compose [t: text (txt)] 10x10 + size-text t] text: txt color: yellow feel: make feel [ engage: func [face action event] [ if action = 'down [data: event/offset] if find [over away] action [ offset: offset + event/offset - data show face ] if action = 'alt-down [print "Hey, stop that!"] ] ] ] ] ] face1: make-face "I wanna stay connected!" 23x45 face2: make-face "Me too, pal, me too!" 58x90 append face2/parents face1 append face1/children face2 view make face [ offset: 100x100 size: 300x300 color: navy edge: none pane: reduce [ face1/fc face2/fc ] ] I know how to draw lines using Draw dialect. Should I have it all Draw based then, and draw the whole thing every time a box moves? (I don't actually understand how to do that). Or is there a neat way, where i can somehow make a "line object" dependable of one or two other objects? How to draw a subpane face, which is a line (and the rest of it transparent in this case). It is easy thing for me to make a line dependent of both ends if somebody tells me how to draw a line as a "face" in this framework. (I am not very familiar with the visual side of Rebol...) Paavo

 [6/7] from: SunandaDH:aol at: 16-Feb-2006 12:08


Paavo:
> 1) How archives work on this list? I found archived messages from 2004 only.
You've probably stumbled across one of the various email list republishers....This ML has been subscribed to several of them over the years, and they all have fragmented sets of messages. The most complete archive is probably the one at REBOL.org: http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-index.r It goes back to mid-2000 and is searchable in various ways. Sunanda.

 [7/7] from: greggirwin::mindspring::com at: 16-Feb-2006 10:42


Hi Paavo, PN> 2) How to draw a line between two movable faces. I need it to implement PN> a simple graph editing functionality. A modified example from the RT docs: PN> I know how to draw lines using Draw dialect. Should I have it all PN> Draw based then, and draw the whole thing every time a box moves? PN> (I don't actually understand how to do that). Or is there a neat PN> way, where i can somehow make a "line object" dependable of one or PN> two other objects? How to draw a subpane face, which is a line (and PN> the rest of it transparent in this case). It is easy thing for me PN> to make a line dependent of both ends if somebody tells me how to PN> draw a line as a "face" in this framework. (I am not very familiar PN> with the visual side of Rebol...) There is no "line object" that makes this easy. When I did a whiteboard app a long time ago, I added faces as the anchors for lines, so they could be grabbed and moved, and the lines themselves were just draw commands for the main "canvas" face. I've included some old code, below, that I used for it (I think; it's been a long time). You could pass faces instead or corner coordinates of course. -- Gregg ; Larry Palmiter map: apply: func [fn blk args /local result][ result: copy [] repeat el blk [append/only result fn :el args] result ] distance: func [ {Always returns a positive value.} a [pair!] b [pair!] ][ square-root add (square first (a - b)) (square second (a - b)) ] all-corners: func [ {Returns all corners of the rectangle given the upper-left and lower-right corners.} ul [pair!] "The upper-left corner of the rectangle" lr [pair!] "The bottom-right corner of the rectangle" /local result ][ result: make block! 4 repend result [ ul to-pair compose [(first ul) (second lr)] ;ur to-pair compose [(first lr) (second ul)] ;ll lr ] return result ] ; My original version ; nearest-point: func ["Returns the point nearest the specified point." ; pt[pair!] "The reference point" ; points[any-block!] "The points you want to check" ; /local result[pair!] ref-dist[decimal!]] [ ; result: first points ; ref-dist: distance pt first points ; foreach p next points [ ; if (distance pt p) < ref-dist [ ; ref-dist: distance pt p ; result: p ; ] ; ] ; return result ; ] ; Condensed version using map function nearest-point: func [ {Returns the point nearest the specified point.} pt [pair!] "The reference point" points [any-block!] "The points you want to check" ][ pick points index? minimum-of (map :distance points pt) ] ; My original version ; farthest-point: func ["Returns the point farthest from the specified point." ; pt[pair!] "The reference point" ; points[any-block!] "The points you want to check" ; /local result[pair!] ref-dist[decimal!]] [ ; result: first points ; ref-dist: distance pt first points ; foreach p next points [ ; if (distance pt p) > ref-dist [ ; ref-dist: distance pt p ; result: p ; ] ; ] ; return result ; ] ; Condensed version using map function farthest-point: func [ {Returns the point farthest from the specified point.} pt [pair!] "The reference point" points [any-block!] "The points you want to check" ][ pick points index? maximum-of (map :distance points pt) ] nearest-corner: func [ "Returns the corner of the retangle nearest the specified point." pt [pair!] "The reference point" ul [pair!] "The upper-left corner of the rectangle" lr [pair!] "The bottom-right corner of the rectangle" ][ nearest-point pt all-corners ul lr ]

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted