Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Slight mod to make is_linux consider Mac as POSIX compliant yet

different.
  • Loading branch information...
commit 4a56467cca44b5ddc9c1624039282237eecf1fe0 1 parent 8a54526
Michaux Kelley authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 mysql-ramdisk.py
View
11 mysql-ramdisk.py
@@ -9,7 +9,7 @@
"""
import os
-
+import sys
from optparse import OptionGroup, OptionParser
from subprocess import Popen, PIPE, call
@@ -20,9 +20,12 @@
def main():
+ # TODO: maybe change RAMDISK_PATH from being a constant to *variable*?
if is_linux():
RAMDISK_PATH = '/mnt/ramdisk'
-
+ else:
+ RAMDISK_PATH = '/dev/disk1'
+
parser = OptionParser()
# Option group for killing ramdisk:
@@ -73,7 +76,9 @@ def main():
def is_linux():
" Return true if os type is linux, and false otherwise. "
- return os.name == 'posix'
+ # TODO: will this work in Windows? idk, but OS 10.6.4 in mac
+ # is also posix, thus the need for the sys.platform check.
+ return os.name == 'posix' and sys.platform != 'darwin'
def disable_apparmor():
if is_linux():
Please sign in to comment.
Something went wrong with that request. Please try again.