comparison src/fileio.c @ 5779:e9d0228c5671

Use a larger buffering size in #'copy-file too. src/ChangeLog addition: 2014-01-16 Aidan Kehoe <kehoea@parhasard.net> * fileio.c (READ_BUF_SIZE): [...] Use it in #'copy-file too, move its #define earlier to make that possible. Not relevant to the coding system buffering, but still helpful.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 16 Jan 2014 21:03:03 +0000
parents 319e18d08654
children 0853e1ec8529
comparison
equal deleted inserted replaced
5778:319e18d08654 5779:e9d0228c5671
1783 if (statptr) 1783 if (statptr)
1784 statptr->st_mode = 0; 1784 statptr->st_mode = 0;
1785 } 1785 }
1786 return; 1786 return;
1787 } 1787 }
1788
1789 #define READ_BUF_SIZE (2 << 16)
1788 1790
1789 DEFUN ("copy-file", Fcopy_file, 2, 4, 1791 DEFUN ("copy-file", Fcopy_file, 2, 4,
1790 "fCopy file: \nFCopy %s to file: \np\nP", /* 1792 "fCopy file: \nFCopy %s to file: \np\nP", /*
1791 Copy FILENAME to NEWNAME. Both args must be strings. 1793 Copy FILENAME to NEWNAME. Both args must be strings.
1792 Signals a `file-already-exists' error if file NEWNAME already exists, 1794 Signals a `file-already-exists' error if file NEWNAME already exists,
1799 */ 1801 */
1800 (filename, newname, ok_if_already_exists, keep_time)) 1802 (filename, newname, ok_if_already_exists, keep_time))
1801 { 1803 {
1802 /* This function can call Lisp. GC checked 2000-07-28 ben */ 1804 /* This function can call Lisp. GC checked 2000-07-28 ben */
1803 int ifd, ofd, n; 1805 int ifd, ofd, n;
1804 Rawbyte buf[16 * 1024]; 1806 Rawbyte buf[READ_BUF_SIZE];
1805 struct stat st, out_st; 1807 struct stat st, out_st;
1806 Lisp_Object handler; 1808 Lisp_Object handler;
1807 int speccount = specpdl_depth (); 1809 int speccount = specpdl_depth ();
1808 struct gcpro gcpro1, gcpro2; 1810 struct gcpro gcpro1, gcpro2;
1809 /* Lisp_Object args[6]; */ 1811 /* Lisp_Object args[6]; */
2868 2870
2869 return (mtime1 > st.st_mtime) ? Qt : Qnil; 2871 return (mtime1 > st.st_mtime) ? Qt : Qnil;
2870 } 2872 }
2871 2873
2872 2874
2873 #define READ_BUF_SIZE (2 << 16)
2874
2875 DEFUN ("insert-file-contents-internal", Finsert_file_contents_internal, 2875 DEFUN ("insert-file-contents-internal", Finsert_file_contents_internal,
2876 1, 7, 0, /* 2876 1, 7, 0, /*
2877 Insert contents of file FILENAME after point; no coding-system frobbing. 2877 Insert contents of file FILENAME after point; no coding-system frobbing.
2878 This function is identical to `insert-file-contents' except for the 2878 This function is identical to `insert-file-contents' except for the
2879 handling of the CODESYS and USED-CODESYS arguments. 2879 handling of the CODESYS and USED-CODESYS arguments.