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

error when writing some double to binary using seekp and write

Here is the code. I notice the first number 57.98 cannot shown correctly. After reading in hex I find out that 57.98 converted to 9 bytes when I write in to the file. How can I fix this? #include #include #include…
hlhc
  • 31
  • 4
0
votes
1 answer

Byte range requests from aws S3

guys so I have a problem consistently and reliably seeking videos with HTML5. I am getting the videos from an AWS S3 Bucket using Nodejs all videos are in mp4 format. I have tried multiple things to get the video's current time to move every time…
0
votes
2 answers

SQL Server - Weird Index Usage

So here is the original query I'm working with SELECT TOP(10) * FROM Orders o WHERE (o.DateAdded >= DATEADD(DAY, - 30, getutcdate())) AND (o.DateAdded <= GETUTCDATE()) ORDER BY o.DateAdded ASC, o.Price ASC o.Quantity DESC Datatype: DateAdded -…
Jacob FW
  • 153
  • 8
0
votes
1 answer

(Python 3) I have some questions regarding seek() and tell()

I am currently learning Python 3 with the Zed Shaw's book, Learning Python 3 The Hard Way. When doing exercise 20 about functions and files, you get tasked with researcher what does the seek function does. By searching online I've come across with a…
0
votes
0 answers

Reading previous lines (bytes) in C#

I would like to ask if there is any posibility to read previous lines (or chars) with StreamReader. My problem is that I am reading pretty big file (even GBs) but sometimes I want to go back to previous (second) '#' (it should be usually in 10k…
0
votes
2 answers

resuming file upload seeking a stream

I am uploading files from clients to server... when the server program receives the stream, property Length is not supported and CanSeek comes false, how would seeking be possible?? I can get the length if I read it in the client and send as a…
blur
  • 1
  • 1
0
votes
0 answers

How do I access the upper half of the 64-bit address space via /proc/x/mem?

No, I don't have a >18 exabyte file anywhere. I'm trying to read from /proc/self/mem. When I do the following in Python: f.seek(0xfe00001de000007f) I get: ValueError: cannot fit 'int' into an offset-sized integer I also tried using os.lseek and…
flarn2006
  • 1,787
  • 15
  • 37
0
votes
1 answer

CSV seek to top not using file

I have a nested for loop and reading from two CSVs. How to seek to beginning of document when I have a reference to the reader and not the file. csv_reader = csv.reader(stdout.decode('ascii').split('\n'), delimiter=' ') for row in csv_reader: for…
Ura
  • 2,173
  • 3
  • 24
  • 41
0
votes
2 answers

Plotting string values acquired from CSV stream on Python

I don't have strong Python & programming background, and currently I am stuck on plotting data/values which I acquired from csv stream. Currently, this is what I have to just print the values streamed from .csv (real-time data from sensor), which I…
messymon
  • 33
  • 1
  • 8
0
votes
1 answer

Custom SLider for video on iPad

I have a custom UISlider and use the currentPlaybackTime to change values of an MPMoviePlayerController object. The problem is when i scrub at a fast rate using the slider, it doesn't respond as fast as i would like.. Is there any better way to…
B K
  • 1,554
  • 3
  • 19
  • 40
0
votes
1 answer

C: Access Violation after numerous uses of fseek

My program goes through this section of my code many times without a problem. Then, in the middle of the file, the file pointer gets set to placeholder (the original address is erased) and i get an access violation when trying to fseek backwards by…
hancholo
  • 3
  • 2
0
votes
2 answers

How to resolve Jwplayer throwing error on seek and will allow the player to load from stored local time

We are trying to get our player load from stored time in local storage. We keep getting this error Error in "beforePlay" event handler: TypeError: can't access property "seekRange", m is null The code that loads is the following: let time =…
ServerStorm
  • 59
  • 1
  • 9
0
votes
3 answers

seeking java access file position, how to learn size of record

I want to move file descriptor to beginning of the record. I have a class named Record. For example, according to parameter, lets say 4, i want to access beginning of the 4. record. In this way, I think I will use seek method. But i need size of…
cemal
  • 121
  • 2
  • 4
  • 9
0
votes
0 answers

File content not reading without seek in python

In my case I am going to write some content to a file in bytearray format and tries to read the content that I have written . But here the problem is if I am not giving the seek function then the file content read is empty. What I understood is by…
Vishnu CS
  • 748
  • 1
  • 10
  • 24
0
votes
0 answers

Why the reading time of a file does not change when I only read 1 every K blocks

I have a 16GB file that I read sequentially from the HD in 4KB blocks and for which I want to calculate the reading time if I read it: one block at a time, one block every 2, one block every 4, ... one block every 512 my code looks…
00101010
  • 1
  • 1