Mercurial > hg > xemacs-beta
comparison src/fileio.c @ 185:3d6bfa290dbd r20-3b19
Import from CVS: tag r20-3b19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:55:28 +0200 |
parents | e121b013d1f0 |
children | 489f57a838ef |
comparison
equal
deleted
inserted
replaced
184:bcd2674570bf | 185:3d6bfa290dbd |
---|---|
597 This operation exists because a directory is also a file, but its name as | 597 This operation exists because a directory is also a file, but its name as |
598 a directory is different from its name as a file. | 598 a directory is different from its name as a file. |
599 The result can be used as the value of `default-directory' | 599 The result can be used as the value of `default-directory' |
600 or passed as second argument to `expand-file-name'. | 600 or passed as second argument to `expand-file-name'. |
601 For a Unix-syntax file name, just appends a slash. | 601 For a Unix-syntax file name, just appends a slash. |
602 On VMS, converts \"[X]FOO.DIR\" to \"[X.FOO]\", etc. | 602 On VMS, converts "[X]FOO.DIR" to "[X.FOO]", etc. |
603 */ | 603 */ |
604 (file)) | 604 (file)) |
605 { | 605 { |
606 /* This function can GC. GC checked 1997.04.06. */ | 606 /* This function can GC. GC checked 1997.04.06. */ |
607 char *buf; | 607 char *buf; |
781 Return the file name of the directory named DIR. | 781 Return the file name of the directory named DIR. |
782 This is the name of the file that holds the data for the directory DIR. | 782 This is the name of the file that holds the data for the directory DIR. |
783 This operation exists because a directory is also a file, but its name as | 783 This operation exists because a directory is also a file, but its name as |
784 a directory is different from its name as a file. | 784 a directory is different from its name as a file. |
785 In Unix-syntax, this function just removes the final slash. | 785 In Unix-syntax, this function just removes the final slash. |
786 On VMS, given a VMS-syntax directory name such as \"[X.Y]\", | 786 On VMS, given a VMS-syntax directory name such as "[X.Y]", |
787 it returns a file name such as \"[X]Y.DIR.1\". | 787 it returns a file name such as "[X]Y.DIR.1". |
788 */ | 788 */ |
789 (directory)) | 789 (directory)) |
790 { | 790 { |
791 /* This function can GC. GC checked 1997.04.06. */ | 791 /* This function can GC. GC checked 1997.04.06. */ |
792 char *buf; | 792 char *buf; |
2581 return call2 (handler, Qfile_symlink_p, filename); | 2581 return call2 (handler, Qfile_symlink_p, filename); |
2582 | 2582 |
2583 bufsize = 100; | 2583 bufsize = 100; |
2584 while (1) | 2584 while (1) |
2585 { | 2585 { |
2586 buf = (char *) xmalloc (bufsize); | 2586 buf = xnew_array_and_zero (char, bufsize); |
2587 memset (buf, 0, bufsize); | |
2588 valsize = readlink ((char *) XSTRING_DATA (filename), | 2587 valsize = readlink ((char *) XSTRING_DATA (filename), |
2589 buf, bufsize); | 2588 buf, bufsize); |
2590 if (valsize < bufsize) break; | 2589 if (valsize < bufsize) break; |
2591 /* Buffer was not long enough */ | 2590 /* Buffer was not long enough */ |
2592 xfree (buf); | 2591 xfree (buf); |
3625 outstream = make_filedesc_output_stream (desc, 0, -1, 0); | 3624 outstream = make_filedesc_output_stream (desc, 0, -1, 0); |
3626 Lstream_set_buffering (XLSTREAM (outstream), | 3625 Lstream_set_buffering (XLSTREAM (outstream), |
3627 LSTREAM_BLOCKN_BUFFERED, 65536); | 3626 LSTREAM_BLOCKN_BUFFERED, 65536); |
3628 #ifdef MULE | 3627 #ifdef MULE |
3629 outstream = | 3628 outstream = |
3630 make_encoding_output_stream ( XLSTREAM (outstream), codesys); | 3629 make_encoding_output_stream (XLSTREAM (outstream), codesys); |
3631 Lstream_set_buffering (XLSTREAM (outstream), | 3630 Lstream_set_buffering (XLSTREAM (outstream), |
3632 LSTREAM_BLOCKN_BUFFERED, 65536); | 3631 LSTREAM_BLOCKN_BUFFERED, 65536); |
3633 #endif /* MULE */ | 3632 #endif /* MULE */ |
3634 if (STRINGP (start)) | 3633 if (STRINGP (start)) |
3635 { | 3634 { |