Multiple file requestor
[1/5] from: btiffin::rogers::com at: 22-Jun-2007 0:03
Hi,
I've got a hack routine to gather a file list. The objective is to let a user
build up a list of files over as many dirs as they want.
;; Request-files, allow a build up of files from multiple calls to
request-dir, request-file
;; The UI for this code...BLOWS, double cancel to get out...it's a proof of
concept.
request-files: has [files file-list dir cwd] [
cwd: what-dir
file-list: copy []
files: copy []
while [dir: request-dir] [ ; Cancel here for out
change-dir dir
while [files: request-file] [ ; Cancel here for back to dir select
append file-list files ; Accumulate the files
]
]
change-dir cwd
unique file-list ; Not sure about use of /case here
]
I can only assume (hope) someone has a better gui filename bagger? Any
pointers? I've looked about a little and came up short. So I thought I'd
ask before building this.
Cheers,
Brian
~~~~
[2/5] from: anton::wilddsl::net::au at: 22-Jun-2007 18:54
Hi Brian,
No need for request-dir, as I see it.
Use /keep to remember the last navigated path in between
requestor selections.
Unique/case is necessary for case-sensitive filesystems
like linux, but not necessary for case-insensitive filesystems
like FAT/NTFS. I recommend supporting case-sensitive in
order to be cross-platform.
How about this:
request-files: has [files result][
result: copy []
while [files: request-file/keep][
append result files
]
unique/case result
]
Regards,
Anton.
[3/5] from: btiffin::rogers::com at: 22-Jun-2007 15:44
VGhhbmtzIEFudG9uLAoKVGhhdHMgYSBsaXR0bGUgY2xlYW5lci4gIDopICAgU3RpbGwgbmVlZHMg
d29yaywgYXMgcmVxdWVzdC1maWxlIGxldHMgeW91IApzZWxlY3QgYSBmaWxlIHRoYXQgZG9lc24n
dCBhY3R1YWxseSBleGlzdC4gIFRoYXQncyBwYXJ0bHkgd2h5IEkgd2FzIGNvbmNlcm5lZCAKYWJv
dXQgdGhlIC9jYXNlIG9uIHVuaXF1ZSwgYnV0IGl0J3MgYmV0dGVyIHRvIGxlYXZlIHRoZSAvY2Fz
ZSBpbiBhbmQganVzdCAKcmVtb3ZlIGFueSBmaWxlcyBmcm9tIHRoZSBsaXN0IHRoYXQgZG9uJ3Qg
ZXhpc3QuICBPciBkbyB0aGUgcmVhbCB3b3JrIGFuZCAKY3JlYXRlIGEgZmlsZSBzZWxlY3Rvci4u
LgoKQ2hlZXJzLApCcmlhbgoKT24gRnJpZGF5IDIyIEp1bmUgMjAwNyAwNDo1NCwgQW50b24gUm9s
bHMgd3JvdGU6Cj4goKCgoKCgoKByZXF1ZXN0LWZpbGVzOiBoYXMgW2ZpbGVzIHJlc3VsdF1bCj4g
oKCgoKCgoKCgoKCgoKCgoHJlc3VsdDogY29weSBbXQo+IKCgoKCgoKCgoKCgoKCgoKB3aGlsZSBb
ZmlsZXM6IHJlcXVlc3QtZmlsZS9rZWVwXVsKPiCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKBhcHBl
bmQgcmVzdWx0IGZpbGVzCj4goKCgoKCgoKCgoKCgoKCgoF0KPiCgoKCgoKCgoKCgoKCgoKCgdW5p
cXVlL2Nhc2UgcmVzdWx0Cj4goKCgoKCgoKBdCg==
[4/5] from: btiffin::rogers::com at: 23-Jun-2007 6:25
Sorry if this is a repeat, the copy I got back was mungled...?
Brian
=2D--------- Forwarded Message ----------
Subject: Re: [REBOL] Re: Multiple file requestor
Date: Friday 22 June 2007 15:44
=46rom: Brian Tiffin <btiffin-rogers.com>
To: rebolist-rebol.com
Thanks Anton,
Thats a little cleaner. :) Still needs work, as request-file lets you
select a file that doesn't actually exist. That's partly why I was concerned
about the /case on unique, but it's better to leave the /case in, and just
remove any files from the list that don't exist. Or do the real work and
create a file selector...
Cheers,
Brian
On Friday 22 June 2007 04:54, Anton Rolls wrote:
> =A0=A0=A0=A0=A0=A0=A0=A0request-files: has [files result][
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0result: copy []
<<quoted lines omitted: 3>>
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0unique/case result
> =A0=A0=A0=A0=A0=A0=A0=A0]
=2D------------------------------------------------------
[5/5] from: anton::wilddsl::net::au at: 24-Jun-2007 12:29
Remove non-existant files from the result.
remove-each file unique/case result [not exists? file]
Anton.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted