Mercurial > jwe > octave
comparison src/dirfns.cc @ 1111:2a36b558ab55
[project @ 1995-02-15 04:01:38 by jwe]
author | jwe |
---|---|
date | Wed, 15 Feb 1995 04:03:31 +0000 |
parents | dfe01093f657 |
children | 27cb099a7af9 |
comparison
equal
deleted
inserted
replaced
1110:456368d90bc7 | 1111:2a36b558ab55 |
---|---|
71 | 71 |
72 #include "statdefs.h" | 72 #include "statdefs.h" |
73 #include "procstream.h" | 73 #include "procstream.h" |
74 #include "tree-const.h" | 74 #include "tree-const.h" |
75 #include "oct-obj.h" | 75 #include "oct-obj.h" |
76 #include "sysdep.h" | |
76 #include "octave.h" | 77 #include "octave.h" |
77 #include "dirfns.h" | 78 #include "dirfns.h" |
78 #include "pager.h" | 79 #include "pager.h" |
79 #include "error.h" | 80 #include "error.h" |
80 #include "utils.h" | 81 #include "utils.h" |
300 if (! the_current_working_directory) | 301 if (! the_current_working_directory) |
301 { | 302 { |
302 char *directory; | 303 char *directory; |
303 | 304 |
304 the_current_working_directory = new char [MAXPATHLEN]; | 305 the_current_working_directory = new char [MAXPATHLEN]; |
305 directory = getcwd (the_current_working_directory, MAXPATHLEN); | 306 directory = octave_getcwd (the_current_working_directory, MAXPATHLEN); |
306 if (! directory) | 307 if (! directory) |
307 { | 308 { |
308 message (for_whom, the_current_working_directory); | 309 message (for_whom, the_current_working_directory); |
309 delete [] the_current_working_directory; | 310 delete [] the_current_working_directory; |
310 the_current_working_directory = 0; | 311 the_current_working_directory = 0; |
342 if (t[len_t] == '/') | 343 if (t[len_t] == '/') |
343 t[len_t] = '\0'; | 344 t[len_t] = '\0'; |
344 } | 345 } |
345 } | 346 } |
346 | 347 |
347 if (chdir (t) < 0) | 348 if (octave_chdir (t) < 0) |
348 { | 349 { |
349 delete [] t; | 350 delete [] t; |
350 return 0; | 351 return 0; |
351 } | 352 } |
352 | 353 |
356 delete [] t; | 357 delete [] t; |
357 return 1; | 358 return 1; |
358 } | 359 } |
359 else | 360 else |
360 { | 361 { |
361 if (chdir (newdir) < 0) | 362 if (octave_chdir (newdir) < 0) |
362 return 0; | 363 return 0; |
363 else | 364 else |
364 return 1; | 365 return 1; |
365 } | 366 } |
366 } | 367 } |
468 char *directory; | 469 char *directory; |
469 | 470 |
470 if (verbatim_pwd) | 471 if (verbatim_pwd) |
471 { | 472 { |
472 char *buffer = new char [MAXPATHLEN]; | 473 char *buffer = new char [MAXPATHLEN]; |
473 directory = getcwd (buffer, MAXPATHLEN); | 474 directory = octave_getcwd (buffer, MAXPATHLEN); |
474 | 475 |
475 if (!directory) | 476 if (!directory) |
476 { | 477 { |
477 warning ("pwd: can't find working directory!"); | 478 warning ("pwd: can't find working directory!"); |
478 delete buffer; | 479 delete buffer; |