how to identify a particular directory / file on remote machine

Mike Meyer mwm at mired.org
Wed Nov 9 20:47:51 EST 2005


"Swarna" <swarnapsv at yahoo.co.in> writes:

> Hi all,
>
> I am trying to find out whether a particular directory is present on a
> remote machine or not from my local Python script in Linux . Can anyone
> help me with the command that i need to issue to os.system in my python
> script to acheive this?

Lots of possibilities, depending on whats running on the remote
machine. My first try would be to use os.popen (or the subprocess
module) and read the output of an "ssh remotemachine ls -d /path/to/dir".

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list