title: How to download p4 files locally?
body: <p>I have a problem with downloading files from Perforce. I need to use python for it, so <code>p4python</code> is the best solution i found. Here what I have:</p>
  
  <pre><code>def connect(username, password):
      p4 = P4()
      p4.port = 'bla.bla.bla.bla:port'
      p4.user = username
      p4.password = password
      p4.client = 'clientname'
  
      p4.connect()
      p4.run_login()
      return p4
  
  def main(username, password):
      try:
          p4 = connect(username, password)
          p4.run_sync()
          p4.disconnect()
      except P4Exception:
          for e in p4.errors:
              print(e)
  </code></pre>
  
  <p>And it works for me, I get files in my workspace directory. BUT I download files to <code>/tmp</code> on server, so when I restart it download only files from last revision, not all the files. How can I download all files every time my workspace directory in not fill?</p>