Changeset 40358d2 for app/src


Ignore:
Timestamp:
05/08/08 16:38:00 (16 years ago)
Author:
obrebski <obrebski@…>
Branches:
master, help
Children:
9b57c4d
Parents:
0e3df7e
git-author:
obrebski <obrebski@…> (05/08/08 16:38:00)
git-committer:
obrebski <obrebski@…> (05/08/08 16:38:00)
Message:

lem, gue, kor, cor sprawdzaja czy slownik istnieje i da sie otworzyc

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@47 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

Location:
app/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • app/src/common/common.cc

    r0e3df7e r40358d2  
    195195// sprawdza istnienie pliku 
    196196int file_accessible(const char* path) { 
    197     return access(path, R_OK); 
     197  return access(path, R_OK); 
    198198} 
    199199 
  • app/src/cor/common_cor.cc

    r25ae32e r40358d2  
    1010    { 
    1111      expand_path(args->dictionary_arg,dictionary); 
     12      if(file_accessible(dictionary)!=0) 
     13        { 
     14          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); 
     15          exit(1); 
     16        } 
    1217    } 
    1318  else if (args->dictionary_home_given && args->language_given) 
     
    1621      expand_path(args->dictionary_home_arg, buf); 
    1722      sprintf(dictionary,"%s/%s/cor.bin",buf,args->language_arg); 
     23      if(file_accessible(dictionary)!=0) 
     24        { 
     25          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); 
     26          exit(1); 
     27        } 
    1828    } 
    1929} 
  • app/src/gue/common_guess.cc

    r25ae32e r40358d2  
    1616    { 
    1717      expand_path(args->dictionary_arg,dictionary); 
     18      if(file_accessible(dictionary)!=0) 
     19        { 
     20          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); 
     21          exit(1); 
     22        } 
    1823    } 
    1924  else if (args->dictionary_home_given && args->language_given) 
     
    2227      expand_path(args->dictionary_home_arg, buf); 
    2328      sprintf(dictionary,"%s/%s/lem.bin",buf,args->language_arg); 
     29      if(file_accessible(dictionary)!=0) 
     30        { 
     31          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); 
     32          exit(1); 
     33        } 
    2434    } 
    2535 
  • app/src/kor/common_cor.cc

    rb3179eb r40358d2  
    1616    { 
    1717      expand_path(args->dictionary_arg,dictionary); 
     18      if(file_accessible(dictionary)!=0) 
     19        { 
     20          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); 
     21          exit(1); 
     22        } 
    1823    } 
    1924  else if (args->dictionary_home_given && args->language_given) 
     
    2227      expand_path(args->dictionary_home_arg, buf); 
    2328      sprintf(dictionary,"%s/%s/cor.bin",buf,args->language_arg); 
     29      if(file_accessible(dictionary)!=0) 
     30        { 
     31          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); 
     32          exit(1); 
     33        } 
    2434    } 
    2535   
  • app/src/lem/common_lem.cc

    r25ae32e r40358d2  
    1111    { 
    1212      expand_path(args->dictionary_arg,dictionary); 
     13      if(file_accessible(dictionary)!=0) 
     14        { 
     15          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); 
     16          exit(1); 
     17        } 
    1318    } 
    1419  else if (args->dictionary_home_given && args->language_given) 
     
    1722      expand_path(args->dictionary_home_arg, buf); 
    1823      sprintf(dictionary,"%s/%s/lem.bin",buf,args->language_arg); 
     24      if(file_accessible(dictionary)!=0) 
     25        { 
     26          fprintf(stderr,"Cannot open the dictionary file: %s\nAborting.\n",dictionary); 
     27          exit(1); 
     28        } 
    1929    } 
    2030} 
Note: See TracChangeset for help on using the changeset viewer.