Re: [Pharo-users] Rename a file

2016-04-18 Thread Tudor Girba
You can also use String>>asFileReference: relative path: './foo.txt' asFileReference absolute path: '/foo.txt' asFileReference Cheers, Doru > On Apr 18, 2016, at 11:01 AM, Cyril Ferlicot Delbecque > wrote: > > > > On 18/04/2016 10:56, Valentin Ryckewaert wrote: >> I'm on Li

Re: [Pharo-users] Rename a file

2016-04-18 Thread Valentin Ryckewaert
An interresting fact is that exists answer true to (FileSystem root / 'aPath/cat.jpg') exists 2016-04-18 11:25 GMT+02:00 Nicolai Hess : > > > 2016-04-18 11:08 GMT+02:00 Sven Van Caekenberghe : > >> Think of it as follows: Pharo is cross platform, forward slash is used on >> *nix and Mac OS, but n

Re: [Pharo-users] Rename a file

2016-04-18 Thread Nicolai Hess
2016-04-18 11:08 GMT+02:00 Sven Van Caekenberghe : > Think of it as follows: Pharo is cross platform, forward slash is used on > *nix and Mac OS, but not Windows where it is backslash. FileReference is an > object oriented API that abstracts over that. Asking for an interpretation > of the sub par

Re: [Pharo-users] Rename a file

2016-04-18 Thread Valentin Ryckewaert
Ok thanks everyone for your answers I got it ! :) 2016-04-18 11:08 GMT+02:00 Sven Van Caekenberghe : > Think of it as follows: Pharo is cross platform, forward slash is used on > *nix and Mac OS, but not Windows where it is backslash. FileReference is an > object oriented API that abstracts over

Re: [Pharo-users] Rename a file

2016-04-18 Thread Sven Van Caekenberghe
Think of it as follows: Pharo is cross platform, forward slash is used on *nix and Mac OS, but not Windows where it is backslash. FileReference is an object oriented API that abstracts over that. Asking for an interpretation of the sub parts is a step too far (even if it would be handy). > On 1

Re: [Pharo-users] Rename a file

2016-04-18 Thread Cyril Ferlicot Delbecque
On 18/04/2016 10:56, Valentin Ryckewaert wrote: > I'm on Linux > > Is it wanted that root / 'a' / 'foo.txt' is different than root / > '.foo.txt' ? I find that strange > If you want a relative path from the image location you can use `FileSystem workingDirectory / 'foo.txt'` -- Cyril Ferlico

Re: [Pharo-users] Rename a file

2016-04-18 Thread Valentin Ryckewaert
I'm on Linux Is it wanted that root / 'a' / 'foo.txt' is different than root / '.foo.txt' ? I find that strange 2016-04-18 10:52 GMT+02:00 Cyril Ferlicot Delbecque < cyril.ferli...@gmail.com>: > > > On 18/04/2016 10:44, Valentin Ryckewaert wrote: > > Using your method (A string asFileReference)

Re: [Pharo-users] Rename a file

2016-04-18 Thread Cyril Ferlicot Delbecque
On 18/04/2016 10:44, Valentin Ryckewaert wrote: > Using your method (A string asFileReference) it works thanks ! > > But if you use FileSystem root / I get the "same" object but it's > still not working. Did I make a mistake somewhere? > Hi, Did you try `FileSystem root / 'a' / 'Path' /

Re: [Pharo-users] Rename a file

2016-04-18 Thread Michal Balda
Hi, I think the problem is using 'aPath/cat.jpg' as a single string (= as a single component of the path). This: path1 := FileSystem root / 'a/b/c.txt'. is different to: path2 := FileSystem root / 'a' / 'b' / 'c.txt'. Compare the results when I ask for the parent directory: path1 p

Re: [Pharo-users] Rename a file

2016-04-18 Thread Valentin Ryckewaert
Using your method (A string asFileReference) it works thanks ! But if you use FileSystem root / I get the "same" object but it's still not working. Did I make a mistake somewhere? 2016-04-18 10:38 GMT+02:00 Sven Van Caekenberghe : > Hi Valentin, > > > On 18 Apr 2016, at 10:31, Valentin Ryck

Re: [Pharo-users] Rename a file

2016-04-18 Thread Sven Van Caekenberghe
Hi Valentin, > On 18 Apr 2016, at 10:31, Valentin Ryckewaert > wrote: > > Hi everyone, > > I'm trying to rename files with this code but it doesn't work, pharo is > saying me "PrimitiveFailed" > I tried lots of things and I'm not finding how I can rename this file, > someone has an idea plea

[Pharo-users] Rename a file

2016-04-18 Thread Valentin Ryckewaert
Hi everyone, I'm trying to rename files with this code but it doesn't work, pharo is saying me "PrimitiveFailed" I tried lots of things and I'm not finding how I can rename this file, someone has an idea please? | myFile | myFile := FileSystem root / 'aPath/cat.jpg'. myFile renameTo:'cats.jpg' V