AltME: Rebol School

Messages

MGilsanz
>> a: 33 * 0.939393939393939
== 31.0
>> b: 31.0
== 31.0
>> to-integer a
== 30
>> to-integer b
== 31
>>
Oldes
http://floating-point-gui.de/
in R3:
>> 33 * 0.939393939393939
== 30.999999999999986
R2 is hiding these details

caelum
Is there a way to preserve the modification date of a file when copying to a new destination using 'write'? As in:
        write/binary dest/:file read/binary source/:file
This produces a modification date of now().
        print modified? 29-Jun-2014/17:02:56-7:00
In the 'Write Function Summary' I do not see any Refinement to preserve the existing modification date. Is there a way to do this?
sqlab
http://www.rebol.org/ml-display-thread.r?m=rmlFDPC
set-modes %afile [modification-date: 12-May-2004/0:00:00+10:00]
Yoi have to manually set the date  of the new file to the date of the old file
Gregg
touch: func [
    {Set the modification timestamp of the file.}
    files [file! block!] "The file, or files, you want to stamp"
    /with "Use a specified time rather than the current time."
        time [date! file!] "The date and time to stamp them with"
    /local read-only?
][
    if not with [time: now]
    if file? time [time: modified? time]
    ; Do we want to do this?
    if 0:00 = time/zone [time/zone: now/zone]
    ; We have to turn off the read-only attribute if it's on.
    foreach item compose [(files)] [
        read-only?: not get-modes item 'owner-write
        ;print ['touching item 'with time]
        set-modes to-file item [owner-write: true modification-date: time]
        if read-only? [set-modes item [owner-write: false]]
    ]
    ; Should we return the time, even though it may not match the actual
    ; stamp on the files due to OS differences?
    ;time
]

caelum
Thanks Gregg and sqlab. Exactly what I was looking for.

caelum
This works fine:
    print get-modes %/path-to-file/filename [modification-date]
But this:
    print get-modes ftp://username@example.com:password@ftp.example.com/filename [modification-date]
produces the following error:
    Script Error: get-modes expected target argument of type: file url block port
    ** Near: system/words/get-modes port/sub-port modes
Does get-modes work over an ftp connection?

GrahamC
Don't think you can do anything except delete, upload and download.
the rebol3 protocol might give you more things you can do.

Reichart
I decided to post this here, since this is the closest topic.
Ever lose your glasses (and they are on your head), or lose your car keys (and they are in the door)?
Many many years ago I wrote a REBOL program that was self modifying.  It also checked to see if it could run, and revert and tell you what went wrong.
I do have a copy of this, but I don't have access to my head or door knob, er, I mean I don't have access to the harddrive (which is in a safe in another state) right now.
I'm hoping someone here has a copy of my old program, I want to show it to a friend I'm teaching REBOL to.

Gregg
I'm pretty sure I don't have it.
Maxim
I've never seen it.
PeterWood
You asked the same quesiton on 26th Jan 2012 on the REBOL3 World.
PeterWood
Endo
I nevet heard of it, but looks cool.

Reichart
Peter, yup, sometimes asking more than once gets a result, never know.
I know where I have a copy of it, but I have to dig into a safe and then pull some old drives out.

Endo
Just for the record: I've added Turkish chars support in pdf-maker.r (Gabriele's script),
I downloaded www.opensource.apple.com/source/vim/vim-44/runtime/print/cp1254.ps file and added Turkish chars from there to
/Differences [...]
If anyone need more info you can write me PM.

Arnold
Can a header be combined for a Red and a REBOL script:
Red [
REBOL[] ;] ; would this work??

Last message posted 184 weeks ago.