World: r3wp
[Core] Discuss core issues
older newer | first last |
Pekr 27-Jun-2006 [5027] | thanks :-) |
Anton 27-Jun-2006 [5028] | so... what are you going to do with "29-Feb-2006" ? |
Pekr 2-Jul-2006 [5029x3] | hmm, why send/attach sends jpeg in some non standard way? When I normally receive jpeg, first it is related to jpeg icon, second it is displayed in my email directly .... |
ah, the difference is: Content-Type: image/jpeg; name="2.jpg" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="2.jpg" --__REBOL--View--1.3.2.3.1--5318724__ Content-Type: application/octet-stream; name="bay.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bay.jpg" | |
rebol does not recognise filetype .... so it uses application/octec-stream .... too many gotchas here, maybe it would be better to construct complete headers. Will look into some alternative attachment sending scripts on rebol.org .... | |
Anton 2-Jul-2006 [5032x2] | Rebol doesn't have a jpeg datatype, so you would have to specify Content-Type to SEND. |
Yes, look for another example which does this already. | |
Pekr 2-Jul-2006 [5034] | thanks .... have you ever heard of this cid: protocol thingy? |
Volker 2-Jul-2006 [5035] | source send source build-attach-body source make-mime-header ;now to find that.. |
Pekr 2-Jul-2006 [5036x2] | ah, build-attach-body ... did not know there are other functions involved ... |
however, I can't parametrise 'send further, so .... | |
Volker 2-Jul-2006 [5038] | but you can check for suffix maybe |
Pekr 2-Jul-2006 [5039] | I can adapt thouse functions probably though ... I need to make different headers .... build-attach-body uses application/octect-stream, without ability to parametrise for e.g. |
Anton 2-Jul-2006 [5040] | How come you are sending JPEGs ? I thought you would want to keep open the possibility of creating your postcard images using rebol, therefore it's better to get PNG working, isn't it ? |
Pekr 2-Jul-2006 [5041x4] | not sure .... but it could be so .... |
simply the plan is - get jpeg (source file), compose with text, send inline, not even as an attachement. It is just that I did not heard about cid: container email reference before ... do all mailers handle pngs? | |
I am also not sure, how many ppl has turned off ability to display html content in email .... maybe it would be better to actually not send post-card .... but post a link to on-server stored image? | |
I will play with what was requested (sending an image) and I will see how can I handle it ... | |
Volker 2-Jul-2006 [5045x5] | There is also something like an inline-image inside the tag. |
<img src="data:image/png;base64,iVBORw0KGgo..." alt="Testbild" /> but non-ie | |
'make-mime-header is inside 'build-attach-body. | |
make-mime-header: func [file] [ net-utils/export context [ Content-Type: join {application/octet-stream; name="} [file {"}] Content-Transfer-Encoding: "base64" Content-Disposition: join {attachment; filename="} [file {" }] ] ] | |
i guess if you patch there based on "suffix? file" it should work | |
JaimeVargas 7-Jul-2006 [5050] | Maybe this useful to someone delimit: func [data /quoted /with separator [string! char!] /local result quote][ result: copy {} unless with [separator: ","] quote: either quoted [:mold][func[x][x]] append result quote form first data foreach value next data [ append result separator append result quote form value ] ] delimit [1 2 3] ;== "1,2,3" delimit/with [1 2 3] ":" ;== "1:2:3" delimit/quoted [1 2 3] ;== {"1","2","3"} delimit/quoted/with [1 2 3] "|" ;== {"1"|"2"|"3"} |
Anton 8-Jul-2006 [5051] | insert insert tail result separator quote form value |
Gabriele 9-Jul-2006 [5052] | keep in mind that mold uses {} instead of "" in a number of cases (included when the size of the string is greater than a certain amount) |
Graham 13-Jul-2006 [5053] | I have to encrypt some rather large files .. many megabytes. Is there an encryption port that will do this in Rebol? Or does encryption require that the whole file be in memory? |
Anton 13-Jul-2006 [5054] | I don't think encryption changes the file-length, so you could just choose a large chunk size and encrypt those separately. |
Graham 13-Jul-2006 [5055] | it does. |
Volker 13-Jul-2006 [5056] | http://www.rebol.com/docs/encryption.html#section-3.1"It is possible to copy from the port before all data has been written" |
Graham 14-Jul-2006 [5057x6] | any reason why Rebol has a get-env function, but not the set-env? |
http://www.rebol.com/docs/view1300.html | |
run Runs the system application associated with a file. I'm sure that is not working ... | |
http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-thread.r?m=rmlPRTS on how to set the environment variables in win32 | |
using the win32 api | |
hmm. Doesn't work. | |
BrianH 14-Jul-2006 [5063] | Graham, there are two good reasons for that: Security and portability. Some platforms have one environment, some have per-process, some have global and per-user (like Windows) - which environment do you want to set? As for security, if you set any variable other than per-process it can affect the behavior of other programs, an ability that should be restricted in a sandboxed environment. You should check out command line apps that you can call to set the various environments on your platform. If the REBOL process doesn't have call because of security restrictions, it shouldn't be able to set environment variables anyways. |
Volker 14-Jul-2006 [5064] | run is available in ios. Somewhere i read in windows one can type a filename in shell, like text.txt, and windows launches the accosiated application. If that works, maybe with 'call too? |
Graham 14-Jul-2006 [5065] | I think the lack of 'run in other than IOS is some type of oversight. |
Volker 14-Jul-2006 [5066] | I agree |
Graham 14-Jul-2006 [5067] | I wonder why using the windows 32 api, I still can't set the user environment variables |
Volker 14-Jul-2006 [5068] | In linux they are copied for each process, not shared AFAIK. MAybe windows does the same? |
Gregg 15-Jul-2006 [5069] | ; Does this work for you Graham? REBOL [] ; GET-ENV is a standard REBOL function now ; environment variable APIs ; msvcrt.dll ; getenv _putenv _environ ; char *getenv( const char *varname ); ; int _putenv( const char *envstring ); lib: load/library %msvcrt.dll get-env: make routine! [ varname [string!] return: [string!] ] lib "getenv" put-env: make routine! [ env-string [string!] return: [integer!] ] lib "_putenv" remove-env-var: func [name [string!]] [put-env join name "="] env-var-exists?: func [name [string!]] [ either "^@" = get-env name [false][true] ] tz-set: make routine! [ return: [integer!] ] lib "_tzset" print get-env "path" print get-env "lib" print get-env "temp" print get-env "test" if 0 <> put-env "test=blah" [ print "error writing environment variable" ] print get-env "test" remove-env-var "test" print mold get-env "test" print get-env "TZ" tz-set free lib halt |
Graham 15-Jul-2006 [5070] | No, it doesn't. It appears to .. but as soon as you quit the rebol session and see if the env variable is still set, it's not. |
BrianH 16-Jul-2006 [5071] | What you are doing there is setting the per-process environment. To set any of the other environments you need some other, somewhat more complex APIs. Or some much more simple command line apps. |
Graham 16-Jul-2006 [5072] | I guess that's why we have get-env and not set-env |
BrianH 18-Jul-2006 [5073x2] | I have a few command line apps that do the job, but the best one I've found I got from a web site that isn't there any more. If you want it PM me and I will email it to you. Otherwise, try setx.exe from the Windows Resource Kit - it can do all sorts of stuff. |
There are 4 environments on Windows (aside from the per-process ones), the system, user, default user and volatile environments. The setenv.exe I found can set any of these 4, the setx.exe in the Resource Kit can set the system and user environments. | |
Graham 18-Jul-2006 [5075] | I'm only looking at present to set the current user environment |
BrianH 18-Jul-2006 [5076] | Do you mean the current user's initial environment, or something less lasting? |
older newer | first last |