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
0
votes
0 answers

Play audio while seeking mp4 file in Swift

I am using self.player.seek(to: to, toleranceBefore: kCMTimeZero, toleranceAfter: kCMTimeZero) to seek through videos, and they play smoothly according to slowly incremented 'to' CMTime. How can I achieve the…
Adam Roszyk
  • 389
  • 1
  • 10
0
votes
1 answer

Python For Loop Search and replace

I am working on a file editing script that is able to find a certain section of the file based on some keywords, then replace a section below it with an alternative section. It is important to know that the files are formatted very strictly so…
paperstsoap
  • 335
  • 4
  • 13
0
votes
1 answer

Seeking key frames using IMediaSample DirectShow.Net

As far as I know, inorder to check if a frame is a key frame or not, I have to check the IMediaSample::IsSyncPoint() method, which returns 0 (S_OK) if the frame is a key frame, or false in the other case. But the IsSyncPoint() method is simply…
bhootjb
  • 1,501
  • 1
  • 21
  • 33
0
votes
0 answers

Android MediaPlayer - seekTo(0) doesn't seek to start

Our app has a lot of music-like audio, in that we have a seekbar, play/pause controls and so forth. The issue we're having is that on some devices, we cannot seek to the start of the file using the seekbar without it stuttering or missing a small…
0
votes
3 answers

Explanation about def rewind(f): f.seek(0)

i was reading a book and there was a code which had a this line in it def rewind(f): f.seek(0) and this is a line that i can't understand can you please explain me what is going on ? from sys import argv script, input_file = argv def…
Amirreza Yegane
  • 315
  • 1
  • 5
  • 14
0
votes
2 answers

Streaming files over the network with random access - java

So ive got a need to play music files from a server on the network, in a java client app. I was thinking Sockets - have the server open a music file as a stream, and have the client connect to that and read & play it as an InputStream. Which would…
dalyons
  • 1,304
  • 3
  • 15
  • 23
0
votes
0 answers

seek. function without output

tips_file = open('code_tips.txt', 'w+') tips_file.write('-use simple function and variable names\n-comment code\n-organize code into functions\n') tips_file.seek(0) tips_text = tips_file.read() print (tips_text) There is no output for the…
Kenglong Wong
  • 67
  • 1
  • 5
0
votes
2 answers

Python - Writing to file using seek

I'm a beginner with Python and am playing around with various ways to do the simple task of reverse-complementing a DNA or RNA sequence to learn some string functions etc. My latest method nearly works but for a minor irritant that I can't find an…
jimbat1
  • 11
  • 3
0
votes
2 answers

Cannot rewind or go forward after initially seek the video?

I am seek the video before it starts play. That is working fine. All videos starts play after the seek time given and playing. That is really fine. But I cannot rewind or forward the video after that. Because if I forward or rewind video starts to…
WP Learner
  • 788
  • 1
  • 13
  • 34
0
votes
1 answer

AVPlayer skip by a specific time

I'm looking for solution to make a function, which forwards video in AVPlayer by for example 10 % of the video each time the user clicks on the button (10% + another 10 % next click + another 10 % next click etc) from the current state in video. So…
lukas28277
  • 97
  • 1
  • 15
0
votes
1 answer

How to use Seek() Method for Writing at the specific position in C#

I have a simple Question to ask, how to use Seek() method in C# to write at the specific position in the Txt file. Example: InfoBrother. //this is the Name. and I want to append - like. Info-Brother //just want to add (-) after "o" in the…
0
votes
1 answer

How to seek to a term using a Lucene IndexReader?

I'm trying to get a multi-phrased query to with a partial match. According to the JavaDoc for MultiPhraseQuery: A generalized version of PhraseQuery, with the possibility of adding more than one term at the same position that are treated as a…
Martinffx
  • 2,426
  • 4
  • 33
  • 60
0
votes
1 answer

Lseek SEEK_END not working?

I'm working on a C program with joysticks and I'd like to get last event which is as the last line of js0 file. I'm trying to move my cursor before the last element but it doesn't seem working. Any idea why? int fd = open ("/dev/input/js0",…
DaSim
  • 363
  • 5
  • 10
0
votes
0 answers

Alternative to fseek() in PHP for files larger than 2-4GB on a 32-bit system

I need to seek around in large files of between 30GB-500GB. Unfortunately I need to do this on a 32-bit system. I've just crashed into PHP's 2GB limit with fseek(), in a way I've not seen documented online. $ php -r 'var_dump(fseek(fopen("/dev/sda",…
i336_
  • 1,813
  • 1
  • 20
  • 41
0
votes
0 answers

Does seekg() function work on the standard input or just in files

does the cin.seekg(0,std::ios::beg) work on standard input? or is there even such a function where i can re-access the beginning of the input after already reading it ? thank you in advance
New dragon
  • 5
  • 1
  • 5