From cc89f57ccf970b47defd4f1f066110fbb6d20330 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 15 May 2002 19:45:38 +0000 Subject: Use access() instead of stat() to determine if the directory exists. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2228 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 3 +++ src/Fl_Preferences.cxx | 12 ++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index b79f574fe..5dbfec3e2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ CHANGES IN FLTK 1.1.0 + - Fl_Preferences::makePath() now uses access() instead + of stat() when checking to see if the destination + directory already exists. - Fl_BMP_Image now supports older BMP files with the 12 byte header. - Optimized the redrawing of tabs and radio/check diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 4c305ccd0..863e7602c 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Preferences.cxx,v 1.1.2.10 2002/05/03 20:30:19 easysw Exp $" +// "$Id: Fl_Preferences.cxx,v 1.1.2.11 2002/05/15 19:45:38 easysw Exp $" // // Preferences methods for the Fast Light Tool Kit (FLTK). // @@ -580,12 +580,8 @@ Fl_Preferences::Name::~Name() int Fl_Preferences::Node::lastEntrySet = -1; // recursively create a path in the file system -static char makePath( const char *path ) -{ - struct stat stats; - int ret = stat( path, &stats ); - if ( ret ) - { +static char makePath( const char *path ) { + if (access(path, 0)) { const char *s = strrchr( path, '/' ); if ( !s ) return 0; int len = s-path; @@ -1084,5 +1080,5 @@ char Fl_Preferences::Node::remove() // -// End of "$Id: Fl_Preferences.cxx,v 1.1.2.10 2002/05/03 20:30:19 easysw Exp $". +// End of "$Id: Fl_Preferences.cxx,v 1.1.2.11 2002/05/15 19:45:38 easysw Exp $". // -- cgit v1.2.3