Index: configure.in =================================================================== RCS file: /cvs/octave/configure.in,v retrieving revision 1.563 diff -c -p -r1.563 configure.in *** configure.in 3 Jun 2007 20:58:28 -0000 1.563 --- configure.in 5 Jun 2007 14:48:50 -0000 *************** AC_CHECK_HEADERS(assert.h curses.h direc *** 1348,1355 **** floatingpoint.h grp.h ieeefp.h inttypes.h limits.h locale.h memory.h nan.h \ ncurses.h poll.h pwd.h stdint.h stdlib.h string.h sys/ioctl.h \ sys/param.h sys/poll.h sys/resource.h sys/select.h sys/stat.h \ ! sys/time.h sys/times.h sys/types.h sys/utsname.h termcap.h \ ! unistd.h varargs.h) ### C++ headers --- 1353,1360 ---- floatingpoint.h grp.h ieeefp.h inttypes.h limits.h locale.h memory.h nan.h \ ncurses.h poll.h pwd.h stdint.h stdlib.h string.h sys/ioctl.h \ sys/param.h sys/poll.h sys/resource.h sys/select.h sys/stat.h \ ! sys/time.h sys/times.h sys/types.h sys/utsname.h sys/utime.h termcap.h \ ! unistd.h utime.h varargs.h) ### C++ headers *************** fi *** 1403,1409 **** ### Checks for functions and variables. ! AC_CHECK_FUNCS(atexit basename bcopy bzero canonicalize_file_name \ dup2 endgrent endpwent execvp fcntl fork getcwd getegid geteuid \ getgid getgrent getgrgid getgrnam getpgrp getpid getppid getpwent \ getpwuid gettimeofday getuid getwd _kbhit kill link localtime_r \ --- 1408,1414 ---- ### Checks for functions and variables. ! AC_CHECK_FUNCS(atexit basename bcopy bzero canonicalize_file_name chmod \ dup2 endgrent endpwent execvp fcntl fork getcwd getegid geteuid \ getgid getgrent getgrgid getgrnam getpgrp getpid getppid getpwent \ getpwuid gettimeofday getuid getwd _kbhit kill link localtime_r \ *************** AC_CHECK_FUNCS(atexit basename bcopy bze *** 1412,1418 **** setlocale setpwent setvbuf sigaction siglongjmp sigpending sigprocmask \ sigsuspend stat strcasecmp strdup strerror stricmp \ strncasecmp strnicmp strsignal symlink tempnam umask \ ! uname unlink usleep vfprintf vsprintf vsnprintf waitpid) case "$canonical_host_type" in *-*-msdosmsvc) --- 1417,1424 ---- setlocale setpwent setvbuf sigaction siglongjmp sigpending sigprocmask \ sigsuspend stat strcasecmp strdup strerror stricmp \ strncasecmp strnicmp strsignal symlink tempnam umask \ ! uname unlink usleep utime vfprintf vsprintf vsnprintf waitpid) ! AC_CHECK_FUNCS(_chmod _utime _utime32) case "$canonical_host_type" in *-*-msdosmsvc) Index: liboctave/file-ops.cc =================================================================== RCS file: /cvs/octave/liboctave/file-ops.cc,v retrieving revision 1.45 diff -c -p -r1.45 file-ops.cc *** liboctave/file-ops.cc 27 Feb 2007 15:12:25 -0000 1.45 --- liboctave/file-ops.cc 5 Jun 2007 14:48:52 -0000 *************** Software Foundation, Inc., 51 Franklin S *** 41,46 **** --- 41,60 ---- #include #endif + #ifdef HAVE_SYS_STAT_H + #include + #endif + + #ifdef HAVE_FCNTL_H + #include + #endif + + #if defined (HAVE_UTIME_H) + #include + #elif defined (HAVE_SYS_UTIME_H) + #include + #endif + #include "dir-ops.h" #include "file-ops.h" #include "file-stat.h" *************** std::string file_ops::dir_sep_str ("/"); *** 64,75 **** #endif #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ ! && defined (OCTAVE_HAVE_POSIX_FILESYSTEM)) std::string file_ops::dir_sep_chars ("/\\"); #else std::string file_ops::dir_sep_chars (file_ops::dir_sep_str); #endif // We provide a replacement for mkdir(). int --- 78,119 ---- #endif #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ ! && (defined (OCTAVE_HAVE_POSIX_FILESYSTEM) || defined (_MSC_VER))) std::string file_ops::dir_sep_chars ("/\\"); #else std::string file_ops::dir_sep_chars (file_ops::dir_sep_str); #endif + #if ! defined (HAVE_CHMOD) && defined (HAVE__CHMOD) + #define chmod _chmod + #define HAVE_CHMOD 1 + #endif + + #if ! defined (HAVE_UTIME) \ + && (defined (HAVE__UTIME) || defined (HAVE__UTIME32)) + #define utime _utime + #define utimbuf _utimbuf + #define HAVE_UTIME 1 + #endif + + #if ! defined (S_IFMT) && defined (_S_IFMT) + #define S_IFMT _S_IFMT + #endif + + #if ! defined (O_RDONLY) && defined (_O_RDONLY) + #define O_RDONLY _O_RDONLY + #define O_WRONLY _O_WRONLY + #define O_CREAT _O_CREAT + #endif + + #ifndef O_BINARY + #ifdef _O_BINARY + #define O_BINARY _O_BINARY + #else + #define O_BINARY 0 + #endif + #endif + // We provide a replacement for mkdir(). int *************** tilde_find_suffix (const std::string& s) *** 644,650 **** for ( ; i < s_len; i++) { ! if (s[i] == file_ops::dir_sep_char) break; if (! suffixes.empty ()) --- 688,694 ---- for ( ; i < s_len; i++) { ! if (file_ops::is_dir_sep (s[i])) break; if (! suffixes.empty ()) *************** isolate_tilde_prefix (const std::string& *** 671,677 **** size_t len = 1; ! while (len < f_len && fname[len] != file_ops::dir_sep_char) len++; return fname.substr (1, len); --- 715,721 ---- size_t len = 1; ! while (len < f_len && ! file_ops::is_dir_sep (fname[len])) len++; return fname.substr (1, len); *************** tilde_expand_word (const std::string& fi *** 692,698 **** // of $HOME or the home directory of the current user, regardless of // any preexpansion hook. ! if (f_len == 1 || filename[1] == file_ops::dir_sep_char) return octave_env::get_home_directory () + filename.substr (1); std::string username = isolate_tilde_prefix (filename); --- 736,742 ---- // of $HOME or the home directory of the current user, regardless of // any preexpansion hook. ! if (f_len == 1 || file_ops::is_dir_sep (filename[1])) return octave_env::get_home_directory () + filename.substr (1); std::string username = isolate_tilde_prefix (filename);