Example #1
0
func FileTest(filename string, test FileTestType) bool {
	cstr := C.CString(filename)
	defer C.free(unsafe.Pointer(cstr))
	ret := C.g_file_test((*C.gchar)(cstr),
		C.GFileTest(test))
	if int(ret) == 0 {
		return false
	}
	return true
}
Example #2
0
var (
	// AsciiType
	ASCII_ALNUM  = C.GAsciiType(C.G_ASCII_ALNUM)
	ASCII_ALPHA  = C.GAsciiType(C.G_ASCII_ALPHA)
	ASCII_CNTRL  = C.GAsciiType(C.G_ASCII_CNTRL)
	ASCII_DIGIT  = C.GAsciiType(C.G_ASCII_DIGIT)
	ASCII_GRAPH  = C.GAsciiType(C.G_ASCII_GRAPH)
	ASCII_LOWER  = C.GAsciiType(C.G_ASCII_LOWER)
	ASCII_PRINT  = C.GAsciiType(C.G_ASCII_PRINT)
	ASCII_PUNCT  = C.GAsciiType(C.G_ASCII_PUNCT)
	ASCII_SPACE  = C.GAsciiType(C.G_ASCII_SPACE)
	ASCII_UPPER  = C.GAsciiType(C.G_ASCII_UPPER)
	ASCII_XDIGIT = C.GAsciiType(C.G_ASCII_XDIGIT)

	// FileTest
	FILE_TEST_IS_REGULAR    = C.GFileTest(C.G_FILE_TEST_IS_REGULAR)
	FILE_TEST_IS_SYMLINK    = C.GFileTest(C.G_FILE_TEST_IS_SYMLINK)
	FILE_TEST_IS_DIR        = C.GFileTest(C.G_FILE_TEST_IS_DIR)
	FILE_TEST_IS_EXECUTABLE = C.GFileTest(C.G_FILE_TEST_IS_EXECUTABLE)
	FILE_TEST_EXISTS        = C.GFileTest(C.G_FILE_TEST_EXISTS)

	// FormatSizeFlags
	FORMAT_SIZE_DEFAULT     = C.GFormatSizeFlags(C.G_FORMAT_SIZE_DEFAULT)
	FORMAT_SIZE_LONG_FORMAT = C.GFormatSizeFlags(C.G_FORMAT_SIZE_LONG_FORMAT)
	FORMAT_SIZE_IEC_UNITS   = C.GFormatSizeFlags(C.G_FORMAT_SIZE_IEC_UNITS)

	// HookFlagMask
	HOOK_FLAG_ACTIVE  = C.GHookFlagMask(C.G_HOOK_FLAG_ACTIVE)
	HOOK_FLAG_IN_CALL = C.GHookFlagMask(C.G_HOOK_FLAG_IN_CALL)
	HOOK_FLAG_MASK    = C.GHookFlagMask(C.G_HOOK_FLAG_MASK)