Skip to content

Commit

Permalink
Added isMac() and isLinux() to neko.io.FileSys
Browse files Browse the repository at this point in the history
  • Loading branch information
jasononeil committed Apr 3, 2012
1 parent d90b446 commit 7b0fcee
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion neko/src/massive/neko/io/FileSys.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****
* Copyright 2011 Massive Interactive. All rights reserved.
* Copyright 2012 Massive Interactive. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
Expand Down Expand Up @@ -33,6 +33,8 @@ import neko.FileSystem;
class FileSys
{
public static var isWindows(get_isWindows, null):Bool;
public static var isMac(get_isMac, null):Bool;
public static var isLinux(get_isLinux, null):Bool;

private static function get_isWindows():Bool
{
Expand All @@ -43,6 +45,24 @@ class FileSys
return isWindows;
}

private static function get_isMac():Bool
{
if(isMac == null)
{
isMac = neko.Sys.systemName().indexOf("Mac") == 0;
}
return isMac;
}

private static function get_isLinux():Bool
{
if(isLinux == null)
{
isLinux = neko.Sys.systemName().indexOf("Linux") == 0;
}
return isLinux;
}


/**
* Fix to remove trailing slash from directories in windows (throws errors on FileSystem methods)
Expand Down

0 comments on commit 7b0fcee

Please sign in to comment.