r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Linux] group for linux REBOL users

Graham
17-Dec-2006
[1086]
request-file: func [

    {Requests a file using a popup list of files and directories.} 
    /title "Change heading on request." 
    title-line "Title line of request" 
    button-text "Button text for selection" 
    /file name "Default file name or block of file names" 
    /filter filt "Filter or block of filters" 
    /keep "Keep previous settings and results" 
    /only "Return only a single file, not a block." 
    /path "Return absolute path followed by relative files." 
    /save "Request file for saving, otherwise loading." 
    /local where data filt-names filt-values
][
    if none? out start-out 
    either file [

        either block? name [picked: copy name] [picked: reduce [to-file name]]
    ] [
        if not keep [picked: copy []]
    ] 
    if none? picked [picked: copy []] 
    if file: picked/1 [where: first split-path file] 
    while [not tail? picked] [
        set [name file] split-path first picked 
        either name <> where [remove picked] [
            change picked file 
            picked: next picked
        ]
    ] 
    picked: head picked 
    if any [not where not exists? where] [where: clean-path %.] 
    if not keep [
        fp/data: head fp/data 
        so/data: head so/data 
        si: 1
    ] 
    either filter [
        filters: either block? filt [filt] [reduce [filt]]
    ] [if any [not keep not block? filters] [pick-filter]] 
    ff/text: form filters 
    tt/text: either title [copy title-line] ["Select a File:"] 
    ob/text: either title [copy button-text] ["Select"] 
    if all [
        error? done: try [
            filt-names: copy head fp/data 
            filt-values: copy filter-list 
            either filter [
                insert head filt-names "Custom" 
                insert/only filt-values filters
            ] [
                filt-names: at filt-names index? fp/data
            ] 
            done: local-request-file data: reduce 

            [tt/text ob/text clean-path where picked filt-names filt-values found? 
            any [only] found? any [save]] 
            if done [
                dir-path: data/3 
                picked: data/4 

                if not filter [fp/data: at head fp/data index? data/5]
            ] 
            done
        ] 
        (get in disarm done 'code) = 328
    ] [
        done: false 
        read-dir/full either where [where] [dir-path] 
        show-pick 
        inform out 
        unfocus
    ] 
    if error? done [done] 
    if all [done picked any [path not empty? picked]] [
        either path [
            done: insert copy picked copy dir-path 
            either only [done/1] [head done]
        ] [
            foreach file picked [insert file dir-path] 
            either only [picked/1] [picked]
        ]
    ]
]
Anton
17-Dec-2006
[1087]
This is the same source as on Windows.

REQUEST-FILE is just a wrapper for LOCAL-REQUEST-FILE, which is native 
on Windows and I suppose might be native on Linux.

You must post source of LOCAL-REQUEST-FILE or rambo the problem if 
it is native.
Volker
17-Dec-2006
[1088]
No, in linux its the old rebol-requester.
Anton
17-Dec-2006
[1089]
Ok, so post the source of LOCAL-REQUEST-FILE here.
Graham
17-Dec-2006
[1090x2]
It's a native
Anyone know how to write to lp ?
Anton
17-Dec-2006
[1092]
A native ? That's seems strange.
btiffin
17-Dec-2006
[1093x2]
*nixes used to just use cp file /dev/lp.
My current Debian has an lp device at /dev/lp0, but alas I have no 
printer to test open %/dev/lp0
Anton
17-Dec-2006
[1095x4]
REQUEST-FILE used to be fully mezzanine.
Does the linux request-file look like this one from View 1.2.1 ?
request-file: func [

    {Requests a file using a popup list of files and directories.}
    /title "Change heading on request."
    title-line "Title line of request"
    button-text "Button text for selection"
    /file name "Default file name or block of file names"
    /filter filt "Filter or block of filters"
    /keep "Keep previous settings and results"
    /only "Return only a single file, not a block."
    /path "Return absolute path followed by relative files."
    /local where
][
    if none? out start-out
    done: false
    either file [

        either block? name [picked: copy name] [picked: reduce [to-file name]]
    ] [
        if not keep [picked: copy []]
    ]
    if none? picked [picked: copy []]
    if file: picked/1 [where: first split-path file]
    while [not tail? picked] [
        set [name file] split-path first picked
        either name <> where [remove picked] [
            change picked file
            picked: next picked
        ]
    ]
    picked: head picked
    if any [not where not exists? where] [where: clean-path %.]
    if not keep [
        fp/data: head fp/data
        so/data: head so/data
        si: 1
    ]
    either filter [
        filters: either block? filt [filt] [reduce [filt]]
    ] [if any [not keep not block? filters] [pick-filter]]
    ff/text: form filters
    tt/text: either title [copy title-line] ["Select a File:"]
    ob/texts/1: either title [copy button-text] ["Select"]
    read-dir/full either where [where] [dir-path]
    show-pick
    inform out
    unfocus
    if all [done picked any [path not empty? picked]] [
        either path [
            done: insert copy picked copy dir-path
            either only [done/1] [head done]
        ] [
            foreach file picked [insert file dir-path]
            either only [picked/1] [picked]
        ]
    ]
]
It uses SLIDER and you would want those replaced with SCROLLER.
(LOCAL-REQUEST-FILE was introduced by View 1.2.5, by the way.)
Graham
17-Dec-2006
[1099x4]
that's it?
This is the latest view on Linux .. odd that RT haven't done this.
I really wonder how many people are using Linux versions of Rebol.
for other than cgi ...
btiffin
17-Dec-2006
[1103x2]
Debian Etch RC1 is working nicely with 1.3.2, as is AltMe 1.1.29. 
 Ive only been etched a few weeks now.
The Debian and Mozilla people have got to get together on the forking... 
 IceApe?  IceWeasel?  :)
Graham
17-Dec-2006
[1105x2]
I'm using Etch as vmware
Annoyingly it loses the network connection if I suspend it ...
btiffin
17-Dec-2006
[1107]
I've always liked the linux'es since (although they have been more 
prone to flake out with certain hardware configs) when the os crashes, 
I can think to myself...At least no one got paid.  :)  Not like the 
old and getting rarer 250 billion dollar blue screen of death.
Anton
17-Dec-2006
[1108]
I'm planning to set up a linux box as my main workstation soon.
btiffin
17-Dec-2006
[1109x3]
Go for it.  I must admit Gnome and KDE are getting that 'smooth' 
feel.  What are us crusty old CLI coders going to do  :)
Debian's package list is impressive.  And there is nothing stopping 
you from Dl'ing unpackaged goods.  Ubuntu comes no cost for free 
they pay postage...free.  And it's based on Debian, and perhaps making 
mama and papa a little jealous.  :)
All just IMHO
Anton
17-Dec-2006
[1112]
I've gotta get a new machine first.
Graham
17-Dec-2006
[1113]
I guess I'm too used to windows .. linux still feels rather clunky 
to me.
btiffin
17-Dec-2006
[1114]
They

 are getting there.  The open source army.  The polish on some of 
 the themes is getting very close to smooth.  art.gnome.org and other 
 such links.  tango resource standards.  Nice.
Graham
17-Dec-2006
[1115]
Anyone tried running Rebol view under Solaris x86, and Lxrun ?
Volker
17-Dec-2006
[1116]
request-file has a premade layout somewhere. Use that. You have the 
source for request-file in the sdk-sources. Needs some binding-tricks 
if you dont use the real source.
Graham
17-Dec-2006
[1117]
Hmm.  Didn't work.
Anton
18-Dec-2006
[1118]
Remind me to check that out later.
Cyphre
18-Dec-2006
[1119]
Graham: It looks that the version of Rebol you are using on the Fedora 
system has no freetype2 support otherwise you would see in the LDD 
output something like:
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x42487000)
Graham
18-Dec-2006
[1120x4]
hang on ..
going to download the latest linux again ...
looking at builds /042 .. the latest rebview seems to be Dec 05 ??
Anyway, I'm not too interested in the rebview .. just the sdk.
Cyphre
18-Dec-2006
[1124]
I'm not really sure in which Linux exe Carl build or not the Freetype 
support. I only tested under Mepis distribution. I agree Carl should 
release new Linux SDK so all versions for all distros are in sync.
Anton
18-Dec-2006
[1125x3]
Playing with View 1.2.1 REQUEST-FILE

You can bind the patched REQUEST-FILE body to the REQ-FILE context, 
and that makes it work.
I think there's no need for that, however.
All you need to do is this:
replace/all select req-file/start-out [out: layout] 'slider 'scroller
Graham
18-Dec-2006
[1128]
thanks Anton .. let me try that.
Anton
19-Dec-2006
[1129]
Did it work ?
Graham
20-Dec-2006
[1130]
Yep.  Thanks.
Anton
20-Dec-2006
[1131]
Cool, thanks. I'll write that down.
xavier
6-Jan-2007
[1132]
.
Robert
24-Jan-2007
[1133]
Has anyone experience with this one: http://www.openpkg.org
Graham
24-Jan-2007
[1134x2]
I've got a samba share but although I can see files there from the 
linux side, they don't show up on the windows side.  If I drop files 
to the share from the windows side, I can see them.  Is this a permissions 
thing?
not set to readable by world