Changeset 1419 for trunk/gsdl/lib


Ignore:
Timestamp:
2000-08-17T17:07:43+12:00 (24 years ago)
Author:
sjboddie
Message:

Added collector action - also changed the javascript required by all the
rollover buttons

Location:
trunk/gsdl/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/fileutil.cpp

    r1310 r1419  
    147147#include <windows.h>
    148148
    149 bool read_dir (const text_t &dirname, text_tarray &filelist) {
     149bool directory_exists (const text_t &dirname) {
    150150 
    151151  WIN32_FIND_DATA FileData; 
     
    155155 
    156156  hSearch = FindFirstFile(dirpath, &FileData);
    157   if (hSearch == INVALID_HANDLE_VALUE) return false;
     157  delete dirpath;
     158
     159  if (hSearch == INVALID_HANDLE_VALUE) {
     160    return false;
     161  }
     162  return true;
     163}
     164
     165bool read_dir (const text_t &dirname, text_tarray &filelist) {
     166 
     167  WIN32_FIND_DATA FileData; 
     168  HANDLE hSearch;
     169  char *dirpath = dirname.getcstr();
     170  strcat (dirpath, "\\*");
     171 
     172  hSearch = FindFirstFile(dirpath, &FileData);
     173  delete dirpath;
     174
     175  if (hSearch == INVALID_HANDLE_VALUE) {
     176    return false;
     177  }
    158178 
    159179  text_t filename = FileData.cFileName;
     
    176196
    177197#include <dirent.h>
     198
     199bool directory_exists (const text_t &dirname) {
     200
     201  char *tmp = dirname.getcstr();
     202  DIR *dirin = opendir (tmp);
     203  delete tmp;
     204 
     205  if (dirin == NULL) return false;
     206  closedir (dirin);
     207  return true;
     208}
    178209
    179210bool read_dir (const text_t &dirname, text_tarray &filelist) {
  • trunk/gsdl/lib/fileutil.h

    r1310 r1419  
    4444bool file_writable (const text_t &filename);
    4545
     46// returns true if directory exists
     47bool directory_exists (const text_t &dirname);
     48
    4649bool read_dir (const text_t &dirname, text_tarray &filelist);
    4750
Note: See TracChangeset for help on using the changeset viewer.