Rio: binary mode copy not keep

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Rio: binary mode copy not keep

vicnet
Hello,

I try to use Directory addTree:

The src directory I use containts jpeg file.
addTree fails because FileKernel use a FileJpeg in InputStream and there is a input pb on this file.

I try to add binary mode :

 base binary addTree: dest

but it is the same result: input error.

When I copy this file directly with binary mode, it is ok.

addTree collect files/dirs to copy but dot not transmit the binary flag.
Is it normal ?

Directory home binary files first isBinary ==> false !

Should it be true ?

Is there another, 'official', way to binary recursive copy ?


I use Pharo on Windows plateform.

a+
Vicnet
Reply | Threaded
Open this post in threaded view
|

Re: Rio: binary mode copy not keep

Stéphane Ducasse
May be keith will reply to you.
For 1.1 I really want to kick FileDirectory crap out. I'm tired about  
it.

Stef


On Sep 3, 2009, at 8:52 AM, Vicnet wrote:

>
> Hello,
>
> I try to use Directory addTree:
>
> The src directory I use containts jpeg file.
> addTree fails because FileKernel use a FileJpeg in InputStream and  
> there is
> a input pb on this file.
>
> I try to add binary mode :
>
> base binary addTree: dest
>
> but it is the same result: input error.
>
> When I copy this file directly with binary mode, it is ok.
>
> addTree collect files/dirs to copy but dot not transmit the binary  
> flag.
> Is it normal ?
>
> Directory home binary files first isBinary ==> false !
>
> Should it be true ?
>
> Is there another, 'official', way to binary recursive copy ?
>
>
> I use Pharo on Windows plateform.
>
> a+
> Vicnet
> --
> View this message in context: http://n2.nabble.com/Rio-binary-mode-copy-not-keep-tp3571512p3571512.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Rio: binary mode copy not keep

keith1y
In reply to this post by vicnet
Vicnet wrote:
> Hello,
>
> I try to use Directory addTree:
>
> The src directory I use containts jpeg file.
> addTree fails because FileKernel use a FileJpeg in InputStream and there is
> a input pb on this file.
>  
an input what?

> I try to add binary mode :
>
>  base binary addTree: dest
>
> but it is the same result: input error.
>
> When I copy this file directly with binary mode, it is ok.
>
> addTree collect files/dirs to copy but dot not transmit the binary flag.
> Is it normal ?
>
> Directory home binary files first isBinary ==> false !
>
> Should it be true ?
>
>  
the #copyTo: uses binary by default.

However

copyLocalFile:toLocalFile: chooses from a variety of copying methods

I understand that there is a bug here, but I am not really sure what the
problem is with the jpeg file.

Keith

> Is there another, 'official', way to binary recursive copy ?
>
>
> I use Pharo on Windows plateform.
>
> a+
> Vicnet
>  


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Bulk] Re: Rio: binary mode copy not keep

vicnet
Hello,

Keith Hodges a écrit :
>> The src directory I use containts jpeg file.
>> addTree fails because FileKernel use a FileJpeg in InputStream and there is
>> a input pb on this file.
> an input what?

UTF8TextConverter(Object)>>error:'Invalid utf8 input detected'

In fact, there is nothing to deal with FileJpeg, File make the same
error on my image (Exupery with Pharo on Windows).

>> I try to add binary mode :
>>  base binary addTree: dest.

Files from base are not copy in binary mode.

>> addTree collect files/dirs to copy but dot not transmit the binary flag.
>> Is it normal ?
>> Directory home binary files first isBinary ==> false !
>> Should it be true ?

> copyLocalFile:toLocalFile: chooses from a variety of copying methods
> I understand that there is a bug here

Not sure that the pb is here.

I think it is in #entries (or #files,...) method that collect files from
source dir without reporting binary mode from parent.
Peharps, #select: should do the job ?

 > but I am not really sure what the
 > problem is with the jpeg file.

Rigth, the pb is not with jpeg but with copy mode that not transmit.


However, here is a suggestion:
FileKernel>>entries is defined as
   self select: [:e | true ]
a block that only return true is strnage for me.
Why not #contentsIn: in executive that return all entries (like contents
in Collection) ?

a+
Vicnet

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Bulk] Re: Rio: binary mode copy not keep

keith1y
Vicnet wrote:

> Hello,
>
> Keith Hodges a écrit :
>  
>>> The src directory I use containts jpeg file.
>>> addTree fails because FileKernel use a FileJpeg in InputStream and there is
>>> a input pb on this file.
>>>      
>> an input what?
>>    
>
> UTF8TextConverter(Object)>>error:'Invalid utf8 input detected'
>
> In fact, there is nothing to deal with FileJpeg, File make the same
> error on my image (Exupery with Pharo on Windows).
>
>  
>>> I try to add binary mode :
>>>  base binary addTree: dest.
>>>      
>
> Files from base are not copy in binary mode.
>
>  
>>> addTree collect files/dirs to copy but dot not transmit the binary flag.
>>> Is it normal ?
>>> Directory home binary files first isBinary ==> false !
>>> Should it be true ?
>>>      
>
>  
>> copyLocalFile:toLocalFile: chooses from a variety of copying methods
>> I understand that there is a bug here
>>    
>
> Not sure that the pb

What the heck is pb?

>  is here.
>
> I think it is in #entries (or #files,...) method that collect files from
> source dir without reporting binary mode from parent.
> Peharps, #select: should do the job ?
>
>  > but I am not really sure what the
>  > problem is with the jpeg file.
>
> Rigth, the pb is not with jpeg but with copy mode that not transmit.
>
>
> However, here is a suggestion:
> FileKernel>>entries is defined as
>    self select: [:e | true ]
> a block that only return true is strnage for me.
> Why not #contentsIn: in executive that return all entries (like contents
> in Collection) ?
>  
Because #select: already does everything you need in an elegant manner.
The squeak wiki Rio page documents this
> a+
> Vicnet
>  
Sorry but I dont understand most of your email.

All file copies are in binary mode by default, so there should be no
need to copy the binary flag.

Keith

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Bulk] Re: Rio: binary mode copy not keep

Schwab,Wilhelm K
FWIW, I recently had a very similar problem bite me, and had to set the binary mode to fix it.  I _thought_ I had tested the offending code, and maybe I did??  I am still on web 09.07.2; the code has been with me since 6-08, and I noted the failure last month.

Bill



-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Keith Hodges
Sent: Thursday, September 03, 2009 4:31 PM
To: [hidden email]
Subject: Re: [Pharo-project] [Bulk] Re: Rio: binary mode copy not keep

Vicnet wrote:

> Hello,
>
> Keith Hodges a écrit :
>  
>>> The src directory I use containts jpeg file.
>>> addTree fails because FileKernel use a FileJpeg in InputStream and
>>> there is a input pb on this file.
>>>      
>> an input what?
>>    
>
> UTF8TextConverter(Object)>>error:'Invalid utf8 input detected'
>
> In fact, there is nothing to deal with FileJpeg, File make the same
> error on my image (Exupery with Pharo on Windows).
>
>  
>>> I try to add binary mode :
>>>  base binary addTree: dest.
>>>      
>
> Files from base are not copy in binary mode.
>
>  
>>> addTree collect files/dirs to copy but dot not transmit the binary flag.
>>> Is it normal ?
>>> Directory home binary files first isBinary ==> false !
>>> Should it be true ?
>>>      
>
>  
>> copyLocalFile:toLocalFile: chooses from a variety of copying methods
>> I understand that there is a bug here
>>    
>
> Not sure that the pb

What the heck is pb?

>  is here.
>
> I think it is in #entries (or #files,...) method that collect files
> from source dir without reporting binary mode from parent.
> Peharps, #select: should do the job ?
>
>  > but I am not really sure what the
>  > problem is with the jpeg file.
>
> Rigth, the pb is not with jpeg but with copy mode that not transmit.
>
>
> However, here is a suggestion:
> FileKernel>>entries is defined as
>    self select: [:e | true ]
> a block that only return true is strnage for me.
> Why not #contentsIn: in executive that return all entries (like
> contents in Collection) ?
>  
Because #select: already does everything you need in an elegant manner.
The squeak wiki Rio page documents this
> a+
> Vicnet
>  
Sorry but I dont understand most of your email.

All file copies are in binary mode by default, so there should be no need to copy the binary flag.

Keith

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Bulk] Re: Rio: binary mode copy not keep

vicnet
In reply to this post by keith1y
Helllo,

> Sorry but I dont understand most of your email.

Ok, I resume

There are 2 independant pbs:

1) when use Directory>>addTree, I've got:
   UTF8TextConverter(Object)>>error:'Invalid utf8 input detected'
   on stream reading

2) "Directory home binary files first isBinary" return false
   I think it should return true because base dir is binary.

For the suggestion on FileKernel>>entries, it think, IMHO, that
  self select: [:e | true ]
is not so elegant (even Collection have a #contents method, which return self in fact :-) )
But it's not important... just a thought.

a+
Vicnet
Reply | Threaded
Open this post in threaded view
|

Re: [Bulk] Re: Rio: binary mode copy not keep

Miguel Cobá
El vie, 04-09-2009 a las 03:22 -0500, Vicnet escribió:
> Helllo,
>
> > Sorry but I dont understand most of your email.
>
> Ok, I resume
>
> There are 2 independant pbs:

Keith has already asked what is a pb. I suppose that means "problem" in
a very cell-phone-sms-message slang.

>
> 1) when use Directory>>addTree, I've got:
>    UTF8TextConverter(Object)>>error:'Invalid utf8 input detected'
>    on stream reading
>
> 2) "Directory home binary files first isBinary" return false
>    I think it should return true because base dir is binary.
>
> For the suggestion on FileKernel>>entries, it think, IMHO, that
>   self select: [:e | true ]
> is not so elegant (even Collection have a #contents method, which return
> self in fact :-) )
> But it's not important... just a thought.
>
> a+
> Vicnet
>
--
Miguel Cobá
http://miguel.leugim.com.mx


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-project] [Bulk] Re: Rio: binary mode copy not keep

vicnet
Heelo,

Miguel Enrique Cobá Martinez (via Nabble) a écrit :
>  > There are 2 independant pbs:
> Keith has already asked what is a pb. I suppose that means "problem" in
> a very cell-phone-sms-message slang.

Ooooppps.
I don't understand his question ! I just realize my mistake now !!!

Yes, you're rigth. pb is problem for me.

Excuse-me for this shortcut. I never use slang or phone langage, just
one or two terms and this is one of them ! sorry.

a+
Vicnet
Reply | Threaded
Open this post in threaded view
|

Re: [Bulk] Re: Rio: binary mode copy not keep

vicnet
In reply to this post by Miguel Cobá
Hello,

> "Directory home binary files first isBinary" return false
> I think it should return true because base dir is binary.

Is my assertion ok ?

If Directory is in binary mode, should #files return File in binary mode too ?

a+
Vicnet