Questions tagged [seek]

Seeking is the act of moving around a file or file-like object.

Seeking is the act of moving around a file or file-like object.

ANSI C in section 2.3.12.10 specifies thatfseek has the argument structure:

int fseek(FILE *stream, long offset, int whence);

Where:

  • stream is the FILE object to seek (note that this does not have to physically be a file)
  • offset is how much, relative to the whence argument
  • whence is one of
    • SEEK_SET (offset is computed relative to the start of the file)
    • SEEK_CUR (offset is computed relative to the current position)
    • SEEK_END (offset is computed relative to the end of the file)

The majority of languages based upon C, and even many that aren't, have inherited something similar to fseek, but have probably put it somewhere else (ex. Python's file.seek). Check your language of choice's documentation for details.

537 questions
6
votes
3 answers

android: onSeekCompleteListener with VideoView

I am using VideoView to play video files. I am using seekTo function in order to play the video from where it has been left off. However, I wanted to do some operations when the seek operation is finished. For that I need to use…
Farhan
  • 3,206
  • 14
  • 49
  • 62
6
votes
4 answers

Low performance with BufferedReader

I am processing a number of text files line by line using BufferReader.readlLine(). Two files having same size 130MB but one take 40sec to get processed while other takes 75 sec. I noticed one file has 1.8 million of lines while other has 2.1…
samarth
  • 3,866
  • 7
  • 45
  • 60
6
votes
4 answers

How to use "seek" in anime.js in order to control an animation while scrolling? With example, please

The updated anime.js documentation (Controls->Seek) says that you can control the animation while scrolling, but there is no example. Could anyone give an example of how to set up animation.seek? https://animejs.com/documentation/#seekAnim var…
Alessio Paoletti
  • 91
  • 1
  • 1
  • 8
6
votes
2 answers

seekTo in VideoView

I'm having problems with seeking video. My application should resume video from place where it was stopped last time. So I do this: videoView.seekTo(bookmark); videoView.start(); However when it plays I hear sounds form beginning of video for…
underwood
  • 278
  • 1
  • 3
  • 9
6
votes
3 answers

How is Average Seek Time Calculated?

A hard disk system has the following parameters : Number of tracks = 500 Number of sectors/track = 100 Number of bytes /sector = 500 Time taken by the head to move from one track to adjacent track = 1 ms Rotation speed = 600 rpm. What is the…
Akhil Nadh PC
  • 574
  • 1
  • 7
  • 24
6
votes
2 answers

AVPlayer seekToTime not working properly

Im having a problem with seeking with AVPlayer.seekToTime, I have the time index that I want to seek to inside a scrollViewDidScroll method like this: func scrollViewDidScroll(scrollView: UIScrollView) { let offsetTime =…
Garret Kaye
  • 2,412
  • 4
  • 21
  • 45
6
votes
2 answers

Pan to seek AVPlayer

I am trying to pan and seek forwards and backwards in my AVPlayer. It is kind of working but the basic math of determining where the pan is translated to the length of the asset is wrong. Can any one offer assistance? - (void)…
malaki1974
  • 1,605
  • 3
  • 16
  • 32
6
votes
5 answers

lseek/write suddenly returns -1 with errno = 9 (Bad file descriptor)

My application uses lseek() to seek the desired position to write data. The file is successfully opened using open() and my application was able to use lseek() and write() lots of times. At a given time, for some users and not easily reproducable,…
Ger Teunis
  • 945
  • 1
  • 14
  • 30
6
votes
1 answer

PHP - Seek in filehandle pointing to file in zip?

I want to print a particular line (say 200th) of a file in a zip archive. I'm trying the following: $file = new SplFileObject("zip://archive.zip#file.txt"); $file->seek(200); echo $file->key() . "\n"; echo $file->current(); But I get PHP Warning: …
buff
  • 2,063
  • 10
  • 16
6
votes
2 answers

Is there a way to go back when reading a file using seek and calls to next()?

I'm writing a Python script to read a file, and when I arrive at a section of the file, the final way to read those lines in the section depends on information that's given also in that section. So I found here that I could use something like fp =…
aaragon
  • 2,314
  • 4
  • 26
  • 60
6
votes
7 answers

Any seekable compression library?

I'm looking for a general compression library that supports random access during decompression. I want to compress wikipedia into a single compressed format and at the same time I want to decompress/extract individual articles from it. Of course, I…
Wu Yongzheng
  • 1,707
  • 17
  • 23
6
votes
1 answer

Perl seek function

This problem was solved. Thank you very much. My question and the solution I am using is stated below. Question: open IN, "<./test.txt"; seek(IN,10,0); read IN, $temp, 5; seek(IN,20,0); close(IN); The situation is that, my handle will start at…
sflee
  • 1,659
  • 5
  • 32
  • 63
6
votes
4 answers

Can seek and tell work with UTF-8 encoded documents in Python?

I have an application that generates some large log files > 500MB. I have written some utilities in Python that allows me to quickly browse the log file and find data of interest. But I now get some datasets where the file is too big to load it all…
Jeroen Dirks
  • 7,705
  • 12
  • 50
  • 70
6
votes
5 answers

How does Python's seek function work?

If I have some file-like object and do the following: F = open('abc', 'r') ... loc = F.tell() F.seek(loc-10) What does seek do? Does is start at the beginning of the file and read loc-10 bytes? Or is it smart enough just to back up 10 bytes?
jlconlin
  • 14,206
  • 22
  • 72
  • 105
5
votes
3 answers

JWPlayer Prevent SKipping forward unless already watched

I'm using JWPlayer 5.4 and it's setup on the page using the javascript API. What I'd like to do is make it so that users can fastforward/rewing via the seek bar ONLY if they have already played that part of the video. So, if a user is watching the…
Rob
  • 738
  • 3
  • 10
  • 23