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
1 answer

I wonder about the efficiency of seek

I m currently studying the PE structure. I am trying to parse this using perl instead of C. This is not an important thing, but if you read a binary file, you have to jump to a certain section. (For example, to read e_lfanew) I want to read the…
0
votes
0 answers

How to apply seek method for two for loops when reading and writing to files in python 3.7?

I am currently trying to make a simple python script that will extract certain data from a file, and write it to a second file. In my code, I used for loop two times, while reading the file. And I have read that in order to use for loop for the…
Cro Simpson2.0
  • 103
  • 1
  • 5
0
votes
1 answer

Flv playback playheadupdate interval in milliseconds i.e seek to non keyframe

I am having trouble catching events of playhead update in the milli second range . This is in regards to FLV playback of a loaded flv movie. As per the docs the seek() function seeks to keyframes,it takes time as input with the accuracy of…
Aditya P
  • 1,862
  • 5
  • 28
  • 39
0
votes
2 answers

Optimize SQL result to ScreenWriter

I have a program that reads in a folder of files (4GB all together), indexes them, then adds them to a linked SQL database. This all occurs before the form even loads. Now I wish to have another file containing one 13 digit number per line and…
K.Madden
  • 353
  • 1
  • 16
0
votes
1 answer

Check whether stdin/std::cin support seeking

EDIT: I had a stupid bug in the code and fixed this, so things are explicable now. I updated my post accordingly. The following code shows that seeking within the line buffer works. First, the result when piping something into the program. $ echo…
Manuel
  • 6,461
  • 7
  • 40
  • 54
0
votes
2 answers

How to check has VLC.MediaElement seek completed?

I didn't find any event handlers like SeekCompleted build in VLC.MediaElement. I check if seek has completed using following dirty code. Is there any better way to do this? //SET SEEK POSITION VLCMediaPlayerElement.Position = Position; //WAIT UNTIL…
Weissu
  • 409
  • 3
  • 15
0
votes
1 answer

Wrong Signal Amplitude reading .bin-File (seems randomly wrong?)

I got a problem I don't really understand. I have a .bin-File with a timeseries of signals and noise in it. I have the exact timedata, to cut out only the interesting parts. My problem is that sometimes the amplitudes are way to high, and sometimes…
AM_Guy
  • 63
  • 10
0
votes
1 answer

rewind(file pointer) and then fwrite. Won't fwrite overwrite the file contents? C

I came acroos this somewhere. A file is being written and then rewind(fileptr) is done and then what should be written to the beginning of the file is written. But writing at the beginning, won't it overwrite the contents of the file? Please advise.
Namratha
  • 16,630
  • 27
  • 90
  • 125
0
votes
1 answer

Adding and reading integers to RandomAcessFile from a List. All except the last one seem to be "0"

I'm trying to write five random numbers from a List to a file. I think I'm managing to write something but when I try to read the file they are all 0 except the last one. I've searched but most of what I've found just explain how to write one…
0
votes
0 answers

Read specific bytes from a file in PYTHON

I want to read specific part of the binary file. I will implement a binary file to "simulate" an array. For example, assuming that all objects will have the same size (22 bytes hipotetically): Inserting an object at index 0 will occupate from 0-22…
0
votes
1 answer

Access VBA how can I .Seek a value in a recordset, error code '3251' operation is not supported for this type of object

I'm having difficulty writing VBA to accomplish a couple goals: 1. loop through address table ("SunstarAccountsInWebir_SarahTest") to separate out valid from invalid addresses. if invalid - export to different table. 2. If valid, match the address…
rgorowsky
  • 105
  • 1
  • 12
0
votes
1 answer

Supwerpoered SDK AdvanceAudioPlayer Seek is not working on Android

working with SuperpoweredAudvanceAudio Player to seek position when playing file. seeking is done from android context. i checked CrossExample of Android and it reflects me that seek operation is done in LoadSuccess callback, which seems to be…
0
votes
1 answer

Perl: How come "seek" is not working

I'm trying to go through a bunch of text files twice to look for two different values. However, the seek $fh, 0, 0 doesn't seem to work. Why? Please help My codes: use strict; use warnings; ... read_in_data_employer(); read_in_data_union(); …
0
votes
3 answers

How to insert char in middle of text file?

Firstly, I want to insert characters into a text file. I want to print the characters (DAD1) into the middle of the text file (HERE with DA D1) and the text file looks like this => @2100 AB CD EF 12 43 56 A3 B2 34 56 ..... ...............78 @ffb4 FF…
Newbie
  • 45
  • 1
  • 8
0
votes
1 answer

File seek with two-byte characters

I'm writing small log parser, which should find some tags in files. Files are large (512mb) and have the following structure: [2018.07.10 00:30:03:125] VersionInfo\886 ...some data... [2018.07.10 00:30:03:109][TraceID:…
Digital God
  • 471
  • 1
  • 5
  • 17