/[svn]/linuxsampler/trunk/src/common/File.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/common/File.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1910 by senoner, Fri Jun 5 14:22:20 2009 UTC revision 1911 by senoner, Sat Jun 6 13:50:36 2009 UTC
# Line 23  Line 23 
23  #include <cstring>  #include <cstring>
24  #include <errno.h>  #include <errno.h>
25  #include <sstream>  #include <sstream>
26    #include <sys/stat.h>
27    
28  #include "Exception.h"  #include "Exception.h"
29  #include "global_private.h"  #include "global_private.h"
# Line 156  void rewinddir(DIR *dir) Line 157  void rewinddir(DIR *dir)
157      }      }
158  }  }
159    
 int     stat(const char *path, struct stat *buf)  
 {  
         struct _finddata_t  info;  
         long handle;  
         mode_t mode = 0;  
   
         if(!buf | !path)  
                 return -1;  
   
         handle = _findfirst(path, &info);  
         if(handle == -1)  
             return -1;  
         _findclose(handle);  
           
           
         buf->st_size = info.size;  
         buf->st_atime = info.time_access;  
         buf->st_ctime = info.time_create;  
   
                   
         /* | dir/regular | systemfile | readonly | write |*/  
           
     mode = S_IFREG;  
         if(info.attrib & _A_SUBDIR) mode = S_IFDIR;  
         buf->st_mode = mode;  
   
         return 0;  
 }  
   
160  int dirfd(DIR *dirp)  int dirfd(DIR *dirp)
161  {  {
162    if (NULL == dirp)    if (NULL == dirp)

Legend:
Removed from v.1910  
changed lines
  Added in v.1911

  ViewVC Help
Powered by ViewVC