Symbolic links in Pharo

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

Symbolic links in Pharo

Thibault ARLOING

Hi,


I want to create a symbolic link via Pharo.

But I don't know how, I found methods named #isSymlink but none for creation of symbolic links.


Can we create a symbolic link via Pharo ?


Thibault

Reply | Threaded
Open this post in threaded view
|

Re: Symbolic links in Pharo

EstebanLM
right now, you can’t… btw, even #isSymlink method is currently broken (I coded a replacement with UFFI but while making it work with linux I broke it with mac… and no time yet to finish it :( )
but I suppose also creating symlinks is something we can add soon :)

Esteban


On 20 Jun 2016, at 16:22, Thibault ARLOING <[hidden email]> wrote:

Hi,

I want to create a symbolic link via Pharo.
But I don't know how, I found methods named #isSymlink but none for creation of symbolic links.

Can we create a symbolic link via Pharo ? 

Thibault

Reply | Threaded
Open this post in threaded view
|

Re: Symbolic links in Pharo

Thibault ARLOING

Ok, I will create my symbolic links with a bash script until it is available in Pharo 😊


Thanks

Thibault




De : Pharo-users <[hidden email]> de la part de Esteban Lorenzano <[hidden email]>
Envoyé : lundi 20 juin 2016 16:51
À : Any question about pharo is welcome
Objet : Re: [Pharo-users] Symbolic links in Pharo
 
right now, you can’t… btw, even #isSymlink method is currently broken (I coded a replacement with UFFI but while making it work with linux I broke it with mac… and no time yet to finish it :( )
but I suppose also creating symlinks is something we can add soon :)

Esteban


On 20 Jun 2016, at 16:22, Thibault ARLOING <[hidden email]> wrote:

Hi,

I want to create a symbolic link via Pharo.
But I don't know how, I found methods named #isSymlink but none for creation of symbolic links.

Can we create a symbolic link via Pharo ? 

Thibault

Reply | Threaded
Open this post in threaded view
|

Re: Symbolic links in Pharo

HilaireFernandes
In reply to this post by Thibault ARLOING
I guess you can do it with OSSubProcess shell command

Hilaire
--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: Symbolic links in Pharo

Thibault ARLOING

Yes, I know but I want to use only Pharo classes because I don't want to add a dependency to OSSubProcess in my program


thanks anyway for your answer 


Thibault




De : Pharo-users <[hidden email]> de la part de Hilaire <[hidden email]>
Envoyé : lundi 20 juin 2016 17:21
À : [hidden email]
Objet : Re: [Pharo-users] Symbolic links in Pharo
 
I guess you can do it with OSSubProcess shell command

Hilaire
--
Dr. Geo
http://drgeo.eu
drgeo.eu
Be a Geometer! Dr. Geo, a software to design & manipulate interactive geometric sketches. It helps kids to explore geometry. Distributed with its source code it is ...



Reply | Threaded
Open this post in threaded view
|

Re: Symbolic links in Pharo

Peter Uhnak
You can use FFI; just create an object with a method…

MyObject>>system: command
"Perform OS system() call."

^ self ffiCall: #(int system #(char * command)) module: LibC


And then you can do something like

MyObject new system: 'ln -s /tmp/source /tmp/target'

On Mon, Jun 20, 2016 at 5:57 PM, Thibault ARLOING <[hidden email]> wrote:

Yes, I know but I want to use only Pharo classes because I don't want to add a dependency to OSSubProcess in my program


thanks anyway for your answer 


Thibault




De : Pharo-users <[hidden email]> de la part de Hilaire <[hidden email]>
Envoyé : lundi 20 juin 2016 17:21
À : [hidden email]
Objet : Re: [Pharo-users] Symbolic links in Pharo
 
I guess you can do it with OSSubProcess shell command

Hilaire
--
Dr. Geo
http://drgeo.eu
Be a Geometer! Dr. Geo, a software to design & manipulate interactive geometric sketches. It helps kids to explore geometry. Distributed with its source code it is ...




Reply | Threaded
Open this post in threaded view
|

Re: Symbolic links in Pharo

HilaireFernandes
So cool.
For a command taking some time to execute, can it be make non-blocking
for the image?

For example when using it from a Seaside server where you need to
execute such a command but you do not want to bock all the Seaside sessions.

Thanks

Hilaire

Le 20/06/2016 18:03, Peter Uhnák a écrit :

> You can use FFI; just create an object with a method…
>
> MyObject>>system: command
> "Perform OS system() call."
>
> ^ self ffiCall: #(int system #(char * command)) module: LibC
>
>
> And then you can do something like
>
> MyObject new system: 'ln -s /tmp/source /tmp/target'

--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: Symbolic links in Pharo

Peter Uhnak
1) you can fork in the program you are launching
2) you can fork in the command you are launching… just like a regular shell (because that's what system() does) e.g.

MyObject new system: '{ sleep 5; touch /tmp/test.txt; } &'

On Tue, Jun 21, 2016 at 11:00 AM, Hilaire <[hidden email]> wrote:
So cool.
For a command taking some time to execute, can it be make non-blocking
for the image?

For example when using it from a Seaside server where you need to
execute such a command but you do not want to bock all the Seaside sessions.

Thanks

Hilaire

Le 20/06/2016 18:03, Peter Uhnák a écrit :
> You can use FFI; just create an object with a method…
>
> MyObject>>system: command
> "Perform OS system() call."
>
> ^ self ffiCall: #(int system #(char * command)) module: LibC
>
>
> And then you can do something like
>
> MyObject new system: 'ln -s /tmp/source /tmp/target'

--
Dr. Geo
http://drgeo.eu