Changeset 506

Show
Ignore:
Timestamp:
08/30/05 11:47:07 (8 years ago)
Author:
max
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ossie/trunk/ossie/framework/FileSystem_impl.cpp

    r501 r506  
    2323/* SCA */ 
    2424 
    25 #ifdef HAVE_SYS_TYPES_H 
    2625#include <sys/types.h> 
    27 #endif 
    28  
    29 #ifdef HAVE_SYS_STAT_H 
    3026#include <sys/stat.h> 
    31 #endif 
    32  
    3327#include <fcntl.h> 
    3428 
     29#include <string.h> 
     30#ifdef __linux__ 
     31        #include <dirent.h> 
     32#else 
     33        #include "ossie/dirent.h" 
     34        #include <direct.h> 
     35#endif 
     36 
     37#include "ossie/FileSystem_impl.h" 
     38 
    3539#ifdef HAVE_UNISTD_H 
    36 #include <unistd.h> 
    37 #endif 
    38  
    39 #ifdef HAVE_STRING_H 
    40 #include <string.h> 
    41 #endif 
    42  
    43 #ifdef HAVE_DIRENT_H 
    44 #include <dirent.h> 
    45 #endif 
    46  
    47 #include "ossie/FileSystem_impl.h" 
     40        #include <unistd.h> 
     41#else 
     42        #include <iostream> 
     43        #include <io.h> 
     44//      #include <process.h> 
     45//      #include <stdexcept> 
     46//      #include <io.h> 
     47//      #include <string.h> 
     48        using namespace std; 
     49#endif 
    4850 
    4951FileSystem_impl::FileSystem_impl () 
    5052{ 
    5153    root = new char[MAX_CWD_LEN]; 
     54#ifdef __linux__ 
    5255    root = getcwd (root, MAX_CWD_LEN); 
     56#else 
     57    root = _getcwd (root, MAX_CWD_LEN); 
     58#endif 
     59 
    5360    init (); 
    5461} 
     
    8390 
    8491    PortableServer::ObjectId_var oid = _root_poa->activate_object (this); 
     92 
     93        cout<<"Finished File System init"<<endl; 
    8594}; 
    8695 
     
    245254/* designate hard-coded security permissions, may need something else here */ 
    246255     
    247     int fp = creat (fileName, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); 
     256#ifdef __linux__ 
     257        int fp = creat (fileName, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); 
     258#else 
     259    int fp = _creat (fileName, S_IREAD | S_IWRITE); 
     260#endif 
    248261 
    249262    if (fp >= 0) 
     
    285298        oFlag = O_WRONLY; 
    286299 
    287     int fp = ::open (fileName, oFlag, 0, NULL); 
     300#ifdef __linux__ 
     301        int fp = ::open (fileName, oFlag, 0, NULL); 
     302#else 
     303    int fp = _open (fileName, oFlag, 0, NULL); 
     304#endif 
    288305 
    289306    CF::File_ptr file = NULL; 
     
    315332    char *dname = this->appendFileName (this->root, directoryName); 
    316333 
    317     int check = ::mkdir (dname, 0755); 
     334#ifdef __linux__ 
     335        int check = ::mkdir (dname, 0755); 
     336#else 
     337        int check = _mkdir (dname); 
     338#endif 
    318339 
    319340    delete dname;