Guest User

Untitled

a guest
Jul 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. "scripts": {
  2. "postpublish": [
  3. "mkdir /tmp/ffmpeg",
  4. ]
  5. }
  6.  
  7. import zipfile
  8. import os
  9.  
  10. srcFileName = os.getcwd() + '\bin\Release\netcoreapp1.0\prepublish.zip'
  11. tmpFileName = os.getcwd() + '\bin\Release\netcoreapp1.0\publish.zip'
  12.  
  13. with zipfile.ZipFile(srcFileName, 'r') as sz:
  14. with zipfile.ZipFile(tmpFileName, 'w', zipfile.ZIP_DEFLATED) as z:
  15. for name in sz.namelist():
  16. srcFile = sz.open(name, "r")
  17. print(name)
  18. zi = zipfile.ZipInfo(name)
  19. zi.create_system = 3
  20. zi.external_attr = (0o764 << 16)
  21. z.writestr(zi, sz.read(name))
  22. z.close()
  23. sz.close()
Add Comment
Please, Sign In to add comment