Pyro4 - reading files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Pyro4 - reading files

Ganea Ionut
Hello there.

I am currently working on a project involving the use of Pyro4.

I have a scenario.

We have the pc named A, and a pc named B.

On pc B lies a python script, that includes pyro, and a method for reading files.

On pc A, we create an instance to the pyro object on pc B. And we call the method for reading files.

I want to read a file that lies on pc B, from pc A using the method of the pyro object i just created.

Is it possible?

Thank you.


Reply | Threaded
Open this post in threaded view
|

Pyro4 - reading files

Jean-Michel Pichavant
----- Original Message -----

> Hello there.
>
> I am currently working on a project involving the use of Pyro4.
>
> I have a scenario.
>
> We have the pc named A, and a pc named B.
>
> On pc B lies a python script, that includes pyro, and a method for
> reading files.
>
> On pc A, we create an instance to the pyro object on pc B. And we
> call the method for reading files.
>
> I want to read a file that lies on pc B, from pc A using the method
> of the pyro object i just created.
>
> Is it possible?
>
> Thank you.

Hi,

Yes, read http://pythonhosted.org/Pyro4/tutorials.html

If you plan to transfer large files between PCS, make sure you read http://pythonhosted.org/Pyro4/tipstricks.html before, as other solutions may be better suited.

JM


-- IMPORTANT NOTICE:

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Reply | Threaded
Open this post in threaded view
|

Pyro4 - reading files

Irmen de Jong
In reply to this post by Ganea Ionut
On 28-1-2014 21:24, ganea.ionut.iulian at gmail.com wrote:

> Hello there.
>
> I am currently working on a project involving the use of Pyro4.
>
> I have a scenario.
>
> We have the pc named A, and a pc named B.
>
> On pc B lies a python script, that includes pyro, and a method for reading files.
>
> On pc A, we create an instance to the pyro object on pc B. And we call the method for reading files.
>
> I want to read a file that lies on pc B, from pc A using the method of the pyro object i just created.
>
> Is it possible?
>
> Thank you.
>


Sure, and what you are describing, tells me that you have implemented the solution
already... :-)

Interesting might still be that Pyro4 provides some basic stuff by default to get a very
basic file transfer feature; see the getfile method exposed by the built-in Flame
object: http://pythonhosted.org/Pyro4/flame.html

You can of course implement this yourself by simply adding a method to your own Pyro
object that reads the required file and just returns the file contents, like you would
write any normal python method.

That being said, please be aware of the following:

- Pyro is not an efficient choice for transferring large amounts of file data. If you
have performance considerations, it may be better to select a different means of file
transfer (such as ftp or rsync or whatever)

- Security implications because you are providing remote access to local file data.
Again, you might want to select a different way to transfer your files instead that by
itself provides a means of securing access to the files (or you'll have to program it
yourself as part of your Pyro solution)


Irmen