[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

FileUtils changes date of file

Peter.Meier998

5/14/2007 10:17:00 AM

Hi,

I use ruby under WinXP and discovered the following issue.

When I copy a file with the following code

require 'fileutils'
FileUtils.cp("file1','file2')

the date of the destination file won't match the date of the source
file.
It's set to the time of the copy process. But it should be the date of
the original file.
How can I get this working correct?

Thanks
Peter

6 Answers

Robert Klemme

5/14/2007 10:31:00 AM

0

On 14.05.2007 12:16, Peter.Meier998@gmx.de wrote:
> I use ruby under WinXP and discovered the following issue.
>
> When I copy a file with the following code
>
> require 'fileutils'
> FileUtils.cp("file1','file2')
>
> the date of the destination file won't match the date of the source
> file.
> It's set to the time of the copy process. But it should be the date of
> the original file.
> How can I get this working correct?

First of all: this is expected behavior and is similar to what cp does.
So this is in no way "incorrect" even though your expectation was
different because Windows Explorer handles this differently.

To retain meta data do

FileUtils.cp("file1','file2', :preserve => true)

Kind regards


robert

John Joyce

5/14/2007 11:07:00 AM

0


On May 14, 2007, at 7:35 PM, Robert Klemme wrote:

> On 14.05.2007 12:16, Peter.Meier998@gmx.de wrote:
>> I use ruby under WinXP and discovered the following issue.
>> When I copy a file with the following code
>> require 'fileutils'
>> FileUtils.cp("file1','file2')
>> the date of the destination file won't match the date of the source
>> file.
>> It's set to the time of the copy process. But it should be the
>> date of
>> the original file.
>> How can I get this working correct?
>
> First of all: this is expected behavior and is similar to what cp
> does. So this is in no way "incorrect" even though your
> expectation was different because Windows Explorer handles this
> differently.
>
> To retain meta data do
>
> FileUtils.cp("file1','file2', :preserve => true)
>
> Kind regards
>
>
> robert
>
Consider it a difference between copying a file and cloning. Copying
would be the same as what you normally do with a mouse in the GUI.
Cloning would be more like what backup/restore software does with file.
Sure, we can argue that the two things are the same in everyday
language, but it's all built on the logic of whoever first built the
thing, and we can never really assume much of anything about what
some computer term means.

mirjam

6/20/2009 4:34:00 AM

0

Mrs Boedicia >
> Isn't there a place where they lock idiots like this moron away?  How
> one earth does
> the cretin keep escaping!!
>
> Bwahahahahahahahahahahahahahaahahahahahahahaahahahahahar
A person like you with all those Code behaviours you learned in the
WRAF , writes things like the above sentence ... Where is you Lady
Like Behaviour ?
mirjam

george

6/20/2009 8:46:00 PM

0

On Jun 20, 6:24 pm, IAAH <n...@email.exist> wrote:

> You really do make it too easy, you know.
> Seriously. By the way, you owe me two irony meters now.

You should either turn the irony meter off when you come into groups
known for nazi infestation.
Or get the 'almost' bulletproof update which permits actual
conversations with nazis without a sign of wanting to throw up

Boedicia@isp.com

6/20/2009 10:42:00 PM

0

On Jun 20, 1:46 pm, george <gbl...@hnpl.net> wrote:
> On Jun 20, 6:24 pm, IAAH <n...@email.exist> wrote:
>
> > You really do make it too easy, you know.
> > Seriously. By the way, you owe me two irony meters now.
>
> You should either turn the irony meter off when you come into groups
> known for nazi infestation.
> Or get the 'almost' bulletproof update which permits actual
> conversations with nazis without a sign of wanting to throw up

Says idiot "george" who thinks he's a hebe because he lives with one
and wouldn't
know a "nazi" if one bit him. He's like all these other low IQ
morons who watch those
WW2 films with actors who never served a day in their lives and would
faint if they
had to carry anything heavier than their handbags.

Poor georgie, unable to find a mate among his own race managed to find
some jewess
to take him in and we see the result. He's the male equivalent of
daft susie "Cohen"
who thinks she's a jew because she lives with one and is about as jew
as Mickey Rooney.

mirjam

6/21/2009 3:31:00 AM

0

Mrs Boedicia !!

Why do you think that calling everybody with unkind names makes you
more credible , it doesn`t !!!

> Says idiot "george" who thinks he's a hebe because he lives with one
> and wouldn't
> know a "nazi" if one bit him.
Maybe you aren`t aware that most of your Constant AntiSemitic posts,
come straight from Old Nazi `publications` ! But George , Correctly
recognized them as such.

>  He's like all these other low IQ
> morons who watch those
I have noted your strange habit of `looking down` on People who don`t
agree with your ideas. What a pity , if you have such contempt for
people here , why do you bother to posts here at all ?

> WW2 films with actors who never served a day in their lives and would
> faint if they
> had to carry anything heavier than their handbags.
How do you know , what and how , other people would behave ???
When in Need .
Yes i remember you served in the WRAF , but this was in Peace time in
Germany ? Do you know how you will be behave when under Missile fire ?
have you ever been under Gun fire ? Please Don`t judge other people
unless you stood in their shoes.
>
> Poor georgie, unable to find a mate among his own race managed to find
> some jewess
This is a racial Nazi Comment ....
mirjam