Mercurial > hg > octave-lyh
comparison src/syscalls.cc @ 2086:bfb775fb6fe8
[project @ 1996-04-25 05:55:19 by jwe]
author | jwe |
---|---|
date | Thu, 25 Apr 1996 05:55:19 +0000 |
parents | 452f63bfa60c |
children | 1300df4a33d6 |
comparison
equal
deleted
inserted
replaced
2085:7603b37325db | 2086:bfb775fb6fe8 |
---|---|
310 "lstat (NAME)\n\ | 310 "lstat (NAME)\n\ |
311 \n\ | 311 \n\ |
312 Like stat (NAME), but if NAME refers to a symbolic link, returns\n\ | 312 Like stat (NAME), but if NAME refers to a symbolic link, returns\n\ |
313 information about the link itself, not the file that it points to.") | 313 information about the link itself, not the file that it points to.") |
314 { | 314 { |
315 tree_constant retval = -1.0; | 315 octave_value retval = -1.0; |
316 | 316 |
317 if (args.length () == 1) | 317 if (args.length () == 1) |
318 { | 318 { |
319 string fname = oct_tilde_expand (args(0).string_value ()); | 319 string fname = oct_tilde_expand (args(0).string_value ()); |
320 | 320 |
321 if (! error_state) | 321 if (! error_state) |
322 { | 322 { |
323 file_stat fs (fname, false); | 323 file_stat fs (fname, false); |
324 | 324 |
325 if (fs) | 325 if (fs) |
326 retval = tree_constant (mk_stat_map (fs)); | 326 retval = octave_value (mk_stat_map (fs)); |
327 } | 327 } |
328 } | 328 } |
329 else | 329 else |
330 print_usage ("lstat"); | 330 print_usage ("lstat"); |
331 | 331 |
372 } | 372 } |
373 | 373 |
374 DEFUN (pipe, args, , | 374 DEFUN (pipe, args, , |
375 "[file_ids, status] = pipe (): create an interprocess channel") | 375 "[file_ids, status] = pipe (): create an interprocess channel") |
376 { | 376 { |
377 Octave_object retval (2, tree_constant (-1.0)); | 377 octave_value_list retval (2, octave_value (-1.0)); |
378 | 378 |
379 #if defined (HAVE_PIPE) | 379 #if defined (HAVE_PIPE) |
380 int nargin = args.length (); | 380 int nargin = args.length (); |
381 | 381 |
382 if (nargin == 0) | 382 if (nargin == 0) |
432 blksize : size of blocks in the file\n\ | 432 blksize : size of blocks in the file\n\ |
433 blocks : number of blocks allocated for file\n\ | 433 blocks : number of blocks allocated for file\n\ |
434 \n\ | 434 \n\ |
435 If the file does not exist, -1 is returned.") | 435 If the file does not exist, -1 is returned.") |
436 { | 436 { |
437 tree_constant retval = -1.0; | 437 octave_value retval = -1.0; |
438 | 438 |
439 if (args.length () == 1) | 439 if (args.length () == 1) |
440 { | 440 { |
441 string fname = oct_tilde_expand (args(0).string_value ()); | 441 string fname = oct_tilde_expand (args(0).string_value ()); |
442 | 442 |
443 if (! error_state) | 443 if (! error_state) |
444 { | 444 { |
445 file_stat fs (fname); | 445 file_stat fs (fname); |
446 | 446 |
447 if (fs) | 447 if (fs) |
448 retval = tree_constant (mk_stat_map (fs)); | 448 retval = octave_value (mk_stat_map (fs)); |
449 } | 449 } |
450 } | 450 } |
451 else | 451 else |
452 print_usage ("stat"); | 452 print_usage ("stat"); |
453 | 453 |