comparison src/fileio.c @ 124:9b50b4588a93 r20-1b15

Import from CVS: tag r20-1b15
author cvs
date Mon, 13 Aug 2007 09:26:39 +0200
parents cca96a509cfe
children 538048ae2ab8
comparison
equal deleted inserted replaced
123:c77884c6318d 124:9b50b4588a93
2478 For a directory, this means you can access files in that directory. 2478 For a directory, this means you can access files in that directory.
2479 */ 2479 */
2480 (filename)) 2480 (filename))
2481 2481
2482 { 2482 {
2483 /* This function can call lisp */ 2483 /* This function can GC. GC checked 1997.04.10. */
2484 Lisp_Object abspath; 2484 Lisp_Object abspath;
2485 Lisp_Object handler; 2485 Lisp_Object handler;
2486 struct gcpro gcpro1; 2486 struct gcpro gcpro1;
2487 2487
2488 CHECK_STRING (filename); 2488 CHECK_STRING (filename);
2504 Return t if file FILENAME exists and you can read it. 2504 Return t if file FILENAME exists and you can read it.
2505 See also `file-exists-p' and `file-attributes'. 2505 See also `file-exists-p' and `file-attributes'.
2506 */ 2506 */
2507 (filename)) 2507 (filename))
2508 { 2508 {
2509 /* This function can call lisp */ 2509 /* This function can GC. GC checked 1997.04.10. */
2510 Lisp_Object abspath; 2510 Lisp_Object abspath;
2511 Lisp_Object handler; 2511 Lisp_Object handler;
2512 int desc; 2512 int desc;
2513 struct gcpro gcpro1; 2513 struct gcpro gcpro1;
2514 2514
2515 GCPRO1 (filename);
2516 CHECK_STRING (filename); 2515 CHECK_STRING (filename);
2517 abspath = Fexpand_file_name (filename, Qnil); 2516 abspath = Fexpand_file_name (filename, Qnil);
2518 UNGCPRO;
2519 2517
2520 /* If the file name has special constructs in it, 2518 /* If the file name has special constructs in it,
2521 call the corresponding file handler. */ 2519 call the corresponding file handler. */
2522 GCPRO1 (abspath); 2520 GCPRO1 (abspath);
2523 handler = Ffind_file_name_handler (abspath, Qfile_readable_p); 2521 handler = Ffind_file_name_handler (abspath, Qfile_readable_p);
2537 DEFUN ("file-writable-p", Ffile_writable_p, 1, 1, 0, /* 2535 DEFUN ("file-writable-p", Ffile_writable_p, 1, 1, 0, /*
2538 Return t if file FILENAME can be written or created by you. 2536 Return t if file FILENAME can be written or created by you.
2539 */ 2537 */
2540 (filename)) 2538 (filename))
2541 { 2539 {
2542 /* This function can call lisp */ 2540 /* This function can GC. GC checked 1997.04.10. */
2543 Lisp_Object abspath, dir; 2541 Lisp_Object abspath, dir;
2544 Lisp_Object handler; 2542 Lisp_Object handler;
2545 struct stat statbuf; 2543 struct stat statbuf;
2546 struct gcpro gcpro1; 2544 struct gcpro gcpro1;
2547 2545
2582 The value is the name of the file to which it is linked. 2580 The value is the name of the file to which it is linked.
2583 Otherwise returns nil. 2581 Otherwise returns nil.
2584 */ 2582 */
2585 (filename)) 2583 (filename))
2586 { 2584 {
2587 /* This function can call lisp */ 2585 /* This function can GC. GC checked 1997.04.10. */
2588 #ifdef S_IFLNK 2586 #ifdef S_IFLNK
2589 char *buf; 2587 char *buf;
2590 int bufsize; 2588 int bufsize;
2591 int valsize; 2589 int valsize;
2592 Lisp_Object val; 2590 Lisp_Object val;
2634 A directory name spec may be given instead; then the value is t 2632 A directory name spec may be given instead; then the value is t
2635 if the directory so specified exists and really is a directory. 2633 if the directory so specified exists and really is a directory.
2636 */ 2634 */
2637 (filename)) 2635 (filename))
2638 { 2636 {
2639 /* This function can call lisp */ 2637 /* This function can GC. GC checked 1997.04.10. */
2640 Lisp_Object abspath; 2638 Lisp_Object abspath;
2641 struct stat st; 2639 struct stat st;
2642 Lisp_Object handler; 2640 Lisp_Object handler;
2643 struct gcpro gcpro1; 2641 struct gcpro gcpro1;
2644 2642
2668 if the directory so specified exists and really is a readable and 2666 if the directory so specified exists and really is a readable and
2669 searchable directory. 2667 searchable directory.
2670 */ 2668 */
2671 (filename)) 2669 (filename))
2672 { 2670 {
2673 /* This function can call lisp */ 2671 /* This function can GC. GC checked 1997.04.10. */
2674 Lisp_Object handler; 2672 Lisp_Object handler;
2675 2673
2676 /* If the file name has special constructs in it, 2674 /* If the file name has special constructs in it,
2677 call the corresponding file handler. */ 2675 call the corresponding file handler. */
2678 handler = Ffind_file_name_handler (filename, Qfile_accessible_directory_p); 2676 handler = Ffind_file_name_handler (filename, Qfile_accessible_directory_p);
2690 "Return t if file FILENAME is the name of a regular file. 2688 "Return t if file FILENAME is the name of a regular file.
2691 This is the sort of file that holds an ordinary stream of data bytes. 2689 This is the sort of file that holds an ordinary stream of data bytes.
2692 */ 2690 */
2693 (filename)) 2691 (filename))
2694 { 2692 {
2695 /* This function can call lisp */ 2693 /* This function can GC. GC checked 1997.04.10. */
2696 Lisp_Object abspath; 2694 Lisp_Object abspath;
2697 struct stat st; 2695 struct stat st;
2698 Lisp_Object handler; 2696 Lisp_Object handler;
2699 struct gcpro gcpro1; 2697 struct gcpro gcpro1;
2700 2698
2718 DEFUN ("file-modes", Ffile_modes, 1, 1, 0, /* 2716 DEFUN ("file-modes", Ffile_modes, 1, 1, 0, /*
2719 Return mode bits of FILE, as an integer. 2717 Return mode bits of FILE, as an integer.
2720 */ 2718 */
2721 (filename)) 2719 (filename))
2722 { 2720 {
2723 /* This function can call lisp */ 2721 /* This function can GC. GC checked 1997.04.10. */
2724 Lisp_Object abspath; 2722 Lisp_Object abspath;
2725 struct stat st; 2723 struct stat st;
2726 Lisp_Object handler; 2724 Lisp_Object handler;
2727 struct gcpro gcpro1; 2725 struct gcpro gcpro1;
2728 2726
2753 Set mode bits of FILE to MODE (an integer). 2751 Set mode bits of FILE to MODE (an integer).
2754 Only the 12 low bits of MODE are used. 2752 Only the 12 low bits of MODE are used.
2755 */ 2753 */
2756 (filename, mode)) 2754 (filename, mode))
2757 { 2755 {
2758 /* This function can call lisp */ 2756 /* This function can GC. GC checked 1997.04.10. */
2759 Lisp_Object abspath; 2757 Lisp_Object abspath;
2760 Lisp_Object handler; 2758 Lisp_Object handler;
2761 struct gcpro gcpro1; 2759 struct gcpro gcpro1;
2762 2760
2763 GCPRO1 (current_buffer->directory); 2761 GCPRO1 (current_buffer->directory);
2831 If FILE1 does not exist, the answer is nil; 2829 If FILE1 does not exist, the answer is nil;
2832 otherwise, if FILE2 does not exist, the answer is t. 2830 otherwise, if FILE2 does not exist, the answer is t.
2833 */ 2831 */
2834 (file1, file2)) 2832 (file1, file2))
2835 { 2833 {
2836 /* This function can call lisp */ 2834 /* This function can GC. GC checked 1997.04.10. */
2837 Lisp_Object abspath1, abspath2; 2835 Lisp_Object abspath1, abspath2;
2838 struct stat st; 2836 struct stat st;
2839 int mtime1; 2837 int mtime1;
2840 Lisp_Object handler; 2838 Lisp_Object handler;
2841 struct gcpro gcpro1, gcpro2, gcpro3; 2839 struct gcpro gcpro1, gcpro2, gcpro3;