You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- | Read from a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback)
316
319
-- | for details.
320
+
-- |
321
+
-- | The use of an Int as FilePosition restricts this API to reading
322
+
-- | files < 2GB. The call is retained to not break existing code.
323
+
-- | fdReadLarge does not have this restriction.
317
324
fdRead::foralleff.
318
325
FileDescriptor
319
326
->Buffer
@@ -322,7 +329,22 @@ fdRead :: forall eff.
322
329
->MaybeFilePosition
323
330
->Callback (buffer::BUFFER | eff) ByteCount
324
331
->Eff (buffer::BUFFER, fs::FS | eff) Unit
325
-
fdRead fd buff off len pos cb = mkEff $ \_ -> runFn6 fs.read fd buff off len (toNullable pos) (handleCallback cb)
332
+
fdRead fd buff off len pos cb =
333
+
fdReadLarge fd buff off len (map toNumber pos) cb
334
+
335
+
-- | Read from a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback)
336
+
-- | for details.
337
+
-- |
338
+
-- | This version takes the file position as a Number. It can read any file Node can.
339
+
fdReadLarge::foralleff.
340
+
FileDescriptor
341
+
->Buffer
342
+
->BufferOffset
343
+
->BufferLength
344
+
->MaybeNumber
345
+
->Callback (buffer::BUFFER | eff) ByteCount
346
+
->Eff (buffer::BUFFER, fs::FS | eff) Unit
347
+
fdReadLarge fd buff off len pos cb = mkEff $ \_ -> runFn6 fs.read fd buff off len (toNullable pos) (handleCallback cb)
326
348
327
349
-- | Convenience function to fill the whole buffer from the current
328
350
-- | file position.
@@ -337,6 +359,10 @@ fdNext fd buff cb = do
337
359
338
360
-- | Write to a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback)
339
361
-- | for details.
362
+
-- |
363
+
-- | The use of an Int as FilePosition restricts this API to writing
364
+
-- | files < 2GB. The call is retained to not break existing code.
365
+
-- | fdWriteLarge does not have this restriction.
340
366
fdWrite::foralleff.
341
367
FileDescriptor
342
368
->Buffer
@@ -345,7 +371,23 @@ fdWrite :: forall eff.
345
371
->MaybeFilePosition
346
372
->Callback (buffer::BUFFER | eff) ByteCount
347
373
->Eff (buffer::BUFFER, fs::FS | eff) Unit
348
-
fdWrite fd buff off len pos cb = mkEff $ \_ -> runFn6 fs.write fd buff off len (toNullable pos) (handleCallback cb)
374
+
fdWrite fd buff off len pos cb =
375
+
fdWriteLarge fd buff off len (map toNumber pos) cb
376
+
377
+
-- | Write to a file asynchronously. See the [Node Documentation](https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback)
378
+
-- | for details.
379
+
-- |
380
+
-- | This version takes file position as a Number. It can write any file Node can.
381
+
fdWriteLarge::foralleff.
382
+
FileDescriptor
383
+
->Buffer
384
+
->BufferOffset
385
+
->BufferLength
386
+
->MaybeNumber
387
+
->Callback (buffer::BUFFER | eff) ByteCount
388
+
->Eff (buffer::BUFFER, fs::FS | eff) Unit
389
+
fdWriteLarge fd buff off len pos cb = mkEff $ \_ -> runFn6 fs.write fd buff off len (toNullable pos) (handleCallback cb)
390
+
349
391
350
392
-- | Convenience function to append the whole buffer to the current
0 commit comments