title: How to solve "permission denied" for a text file in Raspbian?
body: <p>I have coded a Telegram script in python, using TelegramBotAPI.</p>
  
  <p>It runs perfectly even in windows or in Ubuntu. But there is an issue in Raspbian.</p>
  
  <p>One of the commands call an FTP file and try to write a text file, just with the simple following code.</p>
  
  <pre class="lang-py prettyprint-override"><code>def bajarftp (remote_file):
      ftp = FTP("example.com")  
      ftp.login(user='xxx', passwd=".........")   
      localfile = open("archivo.txt","wb")
      ftp.retrbinary('RETR '+ archivoremoto,localfile.write)
      ftp.quit()
      return 
  </code></pre>
  
  <p>This is a function called from the TelegramBot.</p>
  
  <p>This works on windows or in Ubuntu but in Raspbian the following error occurs</p>
  
  <pre><code>error "permission denied for archivo.txt".
  </code></pre>
  
  <p>I have written agaín the permission but the error still appears</p>
  
  <p>Edit:</p>
  
  <p>Pi:</p>
  
  <pre><code>$ id; pwd; ls -ld
  uid=1000(pi) gid=1000(pi) grupos=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),101(input),108(netdev),997(gpio),998(i2c),999(spi)
  /home/pi/bot2
  drwxrwxrwx 3 pi pi 4096 ago 3 12:34 .
  </code></pre>
  
  <p>Ubuntu:</p>
  
  <pre><code>$ id; pwd; ls -ld
  uid=1000(jmanuelab) gid=1000(jmanuelab) grupos=1000(jmanuelab),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),129(sambashare)
  /home/jmanuelab/bot_2
  drwxr-xr-x 3 jmanuelab jmanuelab 4096 jul 31 20:17 .
  </code></pre>