summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--quikr_util.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/quikr_util.py b/quikr_util.py
new file mode 100644
index 0000000..d055b74
--- /dev/null
+++ b/quikr_util.py
@@ -0,0 +1,15 @@
+# Helper Functions
+
+# Check if file is gzip compressed
+def isCompressed(filename):
+ f = open(filename, "rb")
+
+ # The first two bytes of a tar file are always '1f 8b'
+ if f.read(2) == '\x1f\x8b':
+ f.close()
+ return True
+ else:
+ f.close()
+ return False
+
+