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

Seek Method fails to read the text file C#

Using Seek Method to read a specific part of a text but it fails. I have two classes "allmethods.cs" and "caller.cs" There are two methods in "allmethods.cs" which are "WritingMethod" and "SeekReader" The program should writes in a text file and…
Mina Hafzalla
  • 2,681
  • 9
  • 30
  • 44
0
votes
1 answer

How do you seek in VLC 2.0.6 in C#

I am using a VLC 2.0.6 ActiveX control in a Visual Studio 2012 windows application. I figured out how to load and play a basic video using the following code: axVLCPlugin21.playlist.add(filename, title, null); …
Alpants
  • 766
  • 2
  • 8
  • 19
0
votes
1 answer

loading/streaming a file into a buffer/buffers

I have been trying for a couple of days now to load a file in chunks to allow the user to use very large (GB) files and still keep the speed of the program. Currently i have the following code: using (FileStream filereader = new FileStream(filename,…
user2169674
  • 87
  • 2
  • 8
0
votes
1 answer

Does lseek work on file redirection?

Usually lseek doesn't work on stdin. But, what if I run my program like this: ./a.out < filename Now stdin is a file and not keyboard. Will lseek work there? Can I do lseek(0, -1, SEEK_CUR) and get the same effect like ungetc() ?
Sam
  • 1,842
  • 3
  • 19
  • 33
0
votes
1 answer

Android making a ToggleButton to set the Ringtone to Vibrate

I am currently making an app with a SeekBar in which the SeekBar controls the Music Volume, Ringtone Volume, and Alarm Volume. It works fine but whenever I try to code in a button to set the phone to vibrate, it either crashes the app or it just…
teej
  • 30
  • 3
  • 6
0
votes
1 answer

How can i change the position of a progressBar, after the duration of a videoView?

i have the following code: final SeekBar videoBar = (SeekBar) findViewById(R.id.videoBar); final VideoView videoView = (VideoView)…
rosu alin
  • 5,674
  • 11
  • 69
  • 150
0
votes
1 answer

MPEG-2 seeking, where to start?

I'd like to be able to seek to an arbitrary frame in a MPEG-2 file (from DVD, I guess it's called MPEG-2 Program Stream). So far I had been using OpenCV 2.1 for accessing those frames but that would only work on a frame after frame basis (only…
user1331044
  • 83
  • 1
  • 11
0
votes
1 answer

python - open, seek, write to a file, from another file

I guess I am doing something wrong. I am not sure what it is though, but I keep getting TypeError: expected a character buffer object I just want to open a file, seek to certain offsets and overwrite data from patch1 and patch2. Here is the code I…
james28909
  • 554
  • 2
  • 9
  • 20
0
votes
1 answer

Question About CFile Seek

I am using MFC CFile Seek function. I have a problem about Seek out of file length. CFile cfile; BOOL bResult = cfile.Open( L"C:\\2.TXT", CFile::modeReadWrite | CFile::modeCreate | CFile::modeNoTruncate | CFile::typeBinary |…
user25749
  • 4,825
  • 14
  • 61
  • 83
0
votes
1 answer

Vimeo seekTo jumps to plus older seekTo

I've set seekTo to 30 seconds. When page loads it's directly seeking to 30 secs as required.' Problem: It plays automatically as it seeks to 30 secs on load. (it should seekto 30 secs but should be paused by default) While playing when I drag…
Sailesh Jaiswal
  • 187
  • 1
  • 17
0
votes
1 answer

How can I know where the file pointer is so I can identify a starting position in a file

I am working with more than 6MM rows of ticker symbol data. I would like to grab all of the data for a symbol, do the processing I need, and output the results. I have written code that tells me what line each ticker starts on (see the code below).…
Dr.EMG
  • 159
  • 10
0
votes
1 answer

Red5 1.0 does not play any videos after seeking

I'm using Red5 1.0.0-RC2 and it doesn't play any video after seeking a previous one. The process is the following: 1. start the Red5 server 2. open the client in the browser and "play" with the seekbar 3. shortly it stops working 4. reload the…
haxpanel
  • 4,402
  • 4
  • 43
  • 71
0
votes
2 answers

Perl - Move Pointer to Start of Line

I have 2 files. Obfuscated file called input.txt A second file called mapping.txt consisting of key value pairs. I want to find every occurrence of the key from mapping.txt in input.txt and replace it with the value corresponding to the…
Neon Flash
  • 3,113
  • 12
  • 58
  • 96
0
votes
1 answer

webmmux directshow seeking queues IStream

I am using the directshow filter for muxing a vp8 and vorbis. And MOST IMPORTANTLY I am sending (trying to send actually) the webm file in real time. So there is no file being created. As data is packed into webm after being encoder i send it off…
Evren Bingøl
  • 1,306
  • 1
  • 20
  • 32
0
votes
0 answers

Play and seek mp3 file from server

How can i start from some position or jump to some position(bytes or seconds) and don't forget that i'm streaming mp3 file from server? static private void rawplay(AudioFormat targetFormat, AudioInputStream din) throws Exception { …
user1610362
  • 637
  • 2
  • 9
  • 26