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

World: r3wp

[Core] Discuss core issues

Ladislav
6-Oct-2010
[18670x3]
but, nevermind, I found a work-around
so, in 2.7.7 this one does work for me:

touch: func [
    {touch the given FILE}
    file [file!]
] [
    file: open file
    append file ""
    close file
]
So, this one looks "universal":

touch: func [
    {touch the given FILE}
    file [file!]
] [
    file: open file
    append file ""
    clear tail file
    close file
]
Gregg
6-Oct-2010
[18673]
Universal except that is corrupts binary files and will be very slow 
for large files. I don't know if you can be universal, but you can 
get close:

touch: func [
    {touch the given FILE}
    file [file!]
] [
    file: open/seek/binary file
    append file ""
    clear tail file
    close file
]

You just need to remove /binary for R3.
GrahamC
6-Oct-2010
[18674]
call "touch.exe"
Gregg
6-Oct-2010
[18675x2]
Not standard on Windows.
Though with the above you can't specify a given timestamp, which 
is important for general use.
Maxim
6-Oct-2010
[18677]
IIRC there are touch-like functions in the winAPi...
GrahamC
6-Oct-2010
[18678]
I think if you want a particular timestamp you would have to use 
set-modes.
Gregg
6-Oct-2010
[18679x2]
No direct API I know of Max, but I'd rather stay portable as well.
SetFileTime is as close as you get.
Ladislav
7-Oct-2010
[18681x2]
Universal except that is corrupts binary files
 - did you find any corruption?
Though with the above you can't specify a given timestamp
 - that is exactly what is needed
GrahamC
7-Oct-2010
[18683x2]
What's the safest way to check if a string ends in a "/" or not?
all [ not empty? series #'/" = last series ]  seems painful
Sunanda
7-Oct-2010
[18685]
Is this any better? 
     if "/" = back tail series [print true]
Oldes
7-Oct-2010
[18686]
or:
>> s: "" s/(length? s)
== none
>> s: "/" s/(length? s)
== #"/"
GrahamC
7-Oct-2010
[18687x4]
what's the most efficient ?  :)
perhaps we need a new function : rear: func [ series ][ back tail 
series ]
or 'end or 'hind ..
Actually I like 'endof ...

so i can do

remove endof series
Pekr
7-Oct-2010
[18691]
end of is not correct name. End is end, period :-) 'remove last-of 
series' would be OK though ...
Gabriele
7-Oct-2010
[18692x2]
Ladislav, note that on Unix, the TOUCH command creates the file if 
it does not exist. so I would not necessarily consider that a bug...
Ladislav: also, I think OPEN without /DIRECT will actually read the 
file and then write it back, so it's no different from Geomol's solution 
actually. Gregg's /SEEK/BINARY (actually I think /SEEK implies /BINARY) 
should work better.
Ladislav
7-Oct-2010
[18694]
I do not consider it a bug, but I do want a different behaviour, 
which I have to simulate somehow
Gregg
7-Oct-2010
[18695x2]
Ladislav, yes I saw corruption.
And performance memory issues on large files.
Robert
9-Oct-2010
[18697]
So, I need to send seme emails and need to login into my SMTP server. 
And this mostly fails out-of-the box in Rebol 2 and I can't remember 
what to do to make it work:

>> send [robert-:-muench-:-googlemail-:-com] "Test"
Net-log: ["Opening" "tcp" "for" "esmtp"]
connecting to: mail.saphirion.com
Net-log: [none "220"]

Net-log: {220 mail.saphirion.com ESMTP Exim 4.63 Sat, 09 Oct 2010 
12:12:46 +0200}
Net-log: [["EHLO" system/network/host] "250"]

Net-log: {250-mail.saphirion.com Hello mail.saphirion.com [10.0.0.3]}
Net-log: "250-SIZE 52428800"
Net-log: "250-AUTH LOGIN CRAM-MD5 DIGEST-MD5"
Net-log: "250 HELP"
Net-log: ["Supported auth methods:" [login cram]]
Net-log: ["MAIL FROM: <[robert-:-muench-:-saphirion-:-com]>" "250"]
Net-log: "250 OK"
Net-log: ["RCPT TO: <[robert-:-muench-:-googlemail-:-com]>" "250"]
** User Error: Server error: tcp 530 Relaying not allowed
** Near: insert smtp-port reduce [from reduce [addr] tmp]


I think the probem is that Rebol isn't logging in correctly. Either 
it doesn't understand the supported methods or something else is 
different. Any ideas how I can fix it or track it down?
PeterWood
9-Oct-2010
[18698]
0.k='45
Robert
9-Oct-2010
[18699]
?
PeterWood
9-Oct-2010
[18700x4]
Sorry I forgot to decompress the message:


I have no problem sending from an ESMTP account from Rebol after 
setting the account name and password with set-net:
? set-net is pretty self-explanatory.
You could possibly get this message if you are not directly connected 
to the ISP hosting saphirion.com.

I found this explanation helpful :

http://www.answersthatwork.com/Download_Area/ATW_Library/Networking/Network__3-SMTP_Server_Status_Codes_and_SMTP_Error_Codes.pdf
If it's neither of those this script at REBOL.org may be of help 
:

http://www.rebol.org/view-script.r?script=patch-esmtp-net.r
amacleod
9-Oct-2010
[18704]
whats the easiest way to assign a block of values to a block of words? 

fields: [ref lname fname]
data: [1 "Smith" "Bob"]
ChristianE
9-Oct-2010
[18705]
set fields data
amacleod
9-Oct-2010
[18706]
thanks
Steeve
9-Oct-2010
[18707]
lol
Henrik
9-Oct-2010
[18708]
:-) had amacleod not been a REBOLer, he might have said "stop making 
jokes".
Pekr
9-Oct-2010
[18709]
awesome :-)
amacleod
9-Oct-2010
[18710]
I've been assigning them one at a time this whole time...feel like 
a dope
Steeve
9-Oct-2010
[18711]
Hard time to pass by, don't worry, we sympatize :-)
GrahamC
9-Oct-2010
[18712x3]
this creates globals though
And in R3, it will bypass the setting of locals with funct
and in R2 using the r2/forwards
Steeve
9-Oct-2010
[18715]
he ? SET doesn't modify the bouding context of the words
GrahamC
9-Oct-2010
[18716]
>> unset 'crap
>> context [ set [ crap ] [ 1 ]]
>> crap
== 1
Steeve
9-Oct-2010
[18717]
so what ? you didn't declare 'crap in the context.
SET doesn't modify the context.
GrahamC
9-Oct-2010
[18718]
>> global: 1
== 1
>> do test: funct [ ][ set 'global 2 ]
== 2
>> global
== 2
Steeve
9-Oct-2010
[18719]
so what ? you didn't declare 'crap in the context.
SET doesn't modify the context the words.