From: uz Date: Thu, 20 Sep 2012 20:25:22 +0000 (+0000) Subject: Added a note about errors in disk drives on some platforms that lead to X-Git-Tag: V2.14~246 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=60a47704d4b857aa6626f1c06577f74f53f466e4;p=cc65 Added a note about errors in disk drives on some platforms that lead to failures if files are opened/closed while reading the directory. git-svn-id: svn://svn.cc65.org/cc65/trunk@5828 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/doc/funcref.sgml b/doc/funcref.sgml index 55a8d7ae9..d50c5479b 100644 --- a/doc/funcref.sgml +++ b/doc/funcref.sgml @@ -1,4 +1,4 @@ - +
cc65 function reference @@ -1598,7 +1598,7 @@ Exception is the routine for the keyboard device (which is the default input dev <ref id="cbm_k_open" name="cbm_k_open">, <ref id="cbm_k_chkin" name="cbm_k_chkin"> <tag/Example/None. -</descrip> +</descrip> </quote> @@ -1880,7 +1880,7 @@ routines must be called. only be used in presence of a prototype. </itemize> <tag/Availability/cc65 -<tag/See also/ +<tag/See also/ <ref id="cbm_k_save" name="cbm_k_save">, <ref id="cbm_k_setlfs" name="cbm_k_setlfs">, <ref id="cbm_k_setnam" name="cbm_k_setnam"> @@ -4824,6 +4824,17 @@ be used in presence of a prototype. <item>The returned pointer may point to a statically allocated instance of <tt/struct dirent/, so it may get overwritten by subsequent calls to <tt/readdir/. +<item>On several platforms, namely the CBMs and the Atari, the disk drives get +confused when opening/closing files between directory reads. So for example a +program that reads the list of files on a disk, and after each call to +<tt/readdir/, opens the file to process it, will fail.<newline> +Possible solutions are reading the directory into memory before processing the +file list, or to reset the directory by seeking to the correct position after +opening/closing a file: +<verb> + seekdir (DIR, telldir (DIR)); +</verb> +Platforms known to work without problems are: Apple. </itemize> <tag/Availability/POSIX 1003.1 <tag/See also/