openModeller
Version 1.4.0
|
00001 /* ************************************** 00002 * GARP Modeling Package 00003 * 00004 * ************************************** 00005 * 00006 * Copyright (c), The Center for Research, University of Kansas, 2385 Irving Hill Road, Lawrence, KS 66044-4755, USA. 00007 * Copyright (C), David R.B. Stockwell of Symbiotik Pty. Ltd. 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the license that is distributed with the software. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * license.txt file included with this software for more details. 00016 */ 00017 00018 // Utilities.cpp 00019 00020 unsigned long Seed; // seed for random number generator 00021 unsigned long OrigSeed; // original value for random seed 00022 00031 #include <string.h> 00032 00033 #ifdef __GARPWIN 00034 #include <io.h> 00035 #else 00036 #include <sys/stat.h> 00037 #endif 00038 00039 int getFileSize(char * strFilename) 00040 { 00041 #ifdef __GARPWIN 00042 00043 _finddata_t fileInfo; 00044 _findfirst(strFilename, &fileInfo); 00045 return (int) fileInfo.size; 00046 00047 #else 00048 00049 struct stat stat_p; 00050 stat (strFilename, &stat_p); 00051 return stat_p.st_size; 00052 00053 #endif 00054 }