Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
636 B

  1. import os
  2. szBaseDir = os.getcwd()
  3. # changes to a new directory, independent of where we are on the drive
  4. def ChangeDir(szDest):
  5. os.chdir(szBaseDir + szDest)
  6. # deletes a file of disk, ignoring any assert if the file doesn't exist
  7. def DeleteFile(szFile):
  8. try:
  9. os.unlink(szFile)
  10. except OSError, e:
  11. pass
  12. # returns true if a file exists on disk
  13. def FileExists(szFile):
  14. try:
  15. os.stat(szFile)
  16. return 1
  17. except OSError, e:
  18. return
  19. def ListFiles(szExtension):
  20. try:
  21. szAllFiles = os.listdir(os.getcwd())
  22. return szAllFiles
  23. except OSError, e:
  24. return