JSFileApi: Difference between revisions

70 bytes added ,  30 September 2011
(→‎Interfaces: FileInfo now can't return descriptor)
Line 411: Line 411:
       *
       *
       * @param {(string|regexp|(function(string): boolean)) =} filter. If a [string], uses platform-specific filtering. If a regexp or a function, uses high-level filtering.
       * @param {(string|regexp|(function(string): boolean)) =} filter. If a [string], uses platform-specific filtering. If a regexp or a function, uses high-level filtering.
       * @param {function(string, FileDescriptor.FileInfo, number)} onFile  A function called for each file in the directory, with the name of the file, a (lazy) file info for that file and a file number. If the function returns anything [null], the loop stops immediately and returns the value returned by that function.
       * @param {function(string, FileDescriptor.FileInfo, number, function() FileDescriptor)} onFile  A function called for each file in the directory, with the name of the file, a (lazy) file info for that file and a file number. If the function returns anything [null], the loop stops immediately and returns the value returned by that function.
       *
       *
       * @returns The first value returned by [onFile], or [undefined] otherwise.
       * @returns The first value returned by [onFile], or [undefined] otherwise.
       */
       */
     forEachFile: function(filter, onFile) {
     forEachFile: function(filter, onFile) {
  //Unix:    maps to [opendir], [dfd], [readdir]/[readdir64], lazy calls to [stat]
  //Unix:    maps to [opendir], [dfd], [readdir]/[readdir64], lazy calls to [stat], lazy calls to [openat]/[open], [closedir]
  //Windows: maps to [FindFirstFile], [FindNextFile], [Close]
  //Windows: maps to [FindFirstFile], [FindNextFile], [Close]
     }
     }
184

edits