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

APDU GET response Samsung S4

I am testing sending APDU commands on S3's and S4's. On my S3 I send out the APDU and get back 9000. Knowing that my response also has 8 bytes of data i do: 80C0000010 On my S4 I send out the same APDU as above and get 6108 (61 data available - 08 ,…
Doolali
  • 956
  • 9
  • 13
0
votes
1 answer

C++/seek - which order of file seek is faster?

I'm writing a c++ method that needs to update some chars in an open file (ofstream). The method gets as an input a map, where the key is an offset (position in a file) and the value is a char. Code sample typedef map IntChar_map; void…
idanshmu
  • 5,061
  • 6
  • 46
  • 92
0
votes
0 answers

c# filestream size remains the same

I have this weird problem with a class I implemented for reading files that are appended multiple time per second and are located in network shares. During the first iteration everything is fine and at the end of the reading I keep the last position…
epapas
  • 1
  • 1
0
votes
1 answer

iOS MPMoviePlayercontroller movie seek slider odd behavior

it is since a lot of time that I´m experiencing a weird seek slider behavior when seeking forward or backwards on streamed movies using MPMoviePlayerController. The symptoms are: . You begin the seek gesture on slider and the slider button follows…
OskeeAR
  • 11
0
votes
3 answers

How can I reset a file handle receiving standard input in Perl?

When I issue a Perl script some standard input, e.g. $ awk '{print $1"\t"$2}' foo.txt | myScript.pl I have a script which contains a bug. It reads the first line of standard input, gets something from that first line, and then only parses lines 2…
Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345
0
votes
1 answer

Position bar with seek controls for youtube in flash

I've got a chromeless player working well in a flash document with actionscript 3, however I'm struggling to implement a position bar with seek controls similar to the one you see on the youtube website itself. Can anyone point me in the right…
user1892540
  • 211
  • 1
  • 4
  • 8
0
votes
1 answer

Can't seek mp3 more than 50% with MediaPlayer in AsyncTask

seeking is not work correctly in my code, I can only seek exactly in first half of my files, I tested with mp3 in {30min, 60min, 90min, 120min} and don't work, but with mp4 it's ok. public class Player extends AsyncTask
Alireza MH
  • 573
  • 8
  • 25
0
votes
3 answers

python seek reading file to a specific line

I would like to read a very large file from a line which has a sepecfic word, what is the best way to do that ? lets say it is a file with 50K lines 43511 24622 53213 43534 57656 12121 I want to start reading lines of this file from the line that…
Medya Gh
  • 4,563
  • 5
  • 23
  • 35
0
votes
1 answer

Seek a movie with percentage

I'm using this library to read movies inside a java opengl application. It works nice and it is fast BUT it can allow to seek the video only with percentage, accepting a double parameter: double d = ... myMovie.setPlaybackPercentage(d); this works,…
nkint
  • 11,513
  • 31
  • 103
  • 174
0
votes
2 answers

disable seek forward in jwplayer in mobile browser not working

Below is my code. forward seeking is disabled and its working in desktop browsers. But when it is opened in mobile browsers, disabling forward seek is not working.
kiran kinny
  • 9
  • 1
  • 5
0
votes
2 answers

Checking is a specific byte in a file is set to a specific value in vb

I want to be able to make is so that when my program loads it checks to see if the bytes in the file are set to something specific. If they are set to a certain byte then carry out the code. So I want to be able to make it go to a specific byte,…
avgcoder
  • 372
  • 1
  • 9
  • 27
0
votes
1 answer

Why does the following python code gives unexpected results sometimes?

I wrote a small script to fetch some data from a website and store it in a file. The data is fetched in a variable "content". try: content = urllib.urlopen(url).read() except: content = "" The file has a few short phrases, each on a new…
pymd
  • 4,021
  • 6
  • 26
  • 27
0
votes
0 answers

Cross-platform seeking for large files

Is there a cross-platform fseek() for large files? Seeking fails when exceeding the 2GB limit. size_t chunkSkip = 1024 * 4; uint64_t skipped = 0; while (skipped < args.nSkipBytes) { uint64_t offset; if (skipped + chunkSkip > args.nSkipBytes)…
Niklas R
  • 16,299
  • 28
  • 108
  • 203
0
votes
3 answers

Perl read seek tell, and text files. Too many bytes being read. Layers and newline handling

I've a Perl script which analyses a text file (can be UNIX or windows line endings) storing file offsets when it find something of interest. open(my $fh, $filename); my $groups; my %hash; while(<$fh>) { if($_ =~ /interesting/ ) { …
Chris
  • 538
  • 8
  • 19
0
votes
2 answers

How to enable seeking in Azure Blob stream

I have a BlobStream that is created from the method OpenWriter. var blob = CloudContainer.GetBlobReference(name)); if (blob == null) { return null; } return blob.OpenWrite(); Using this stream i would like to seek or set the position, but each…
Stian Standahl
  • 2,506
  • 4
  • 33
  • 43