Questions tagged [file-header]
13 questions
2
votes
2 answers
PHP: Checking if file exists, but @get_headers affecting tracker
I'm using PHP to check if an .html file exists on the server. However, @get_headers seems to be "visiting" the page when it checks for the file, and my tracking script that produces an analytics report is picking that up as a page view. Is there…

John
- 473
- 5
- 20
2
votes
2 answers
How to read bmp file header in python?
I need to read the header of a bmp file with python. I tried like this but it obviously returns just a bunch of non intelligible bytes:
f = open(input_filename,"rb")
data = bytearray(f.read())
f.close()
print(data[:14])
My idea was to find a…

RobiNoob
- 255
- 1
- 6
- 16
1
vote
0 answers
Reading header values from a binary file blob in pure JavaScript
Suppose I have a bufferArray object buff that holds a file.
Suppose, the file has a header with file properties that are different in size and are located at different offsets.
For example:
Offset | Length (bytes) | Property
0, 4, File signature
4,…

InfiniteLoop
- 387
- 1
- 3
- 18
1
vote
1 answer
Remove file header from a .wav file in python3
I have been doing a project on encrypting .wav files using RSA algo and for that, I need to remove the file header to read the file properly. I need the sound data as a numpy array. Now I've searched the web for this and didn't understand what is…

Sandipan
- 683
- 8
- 25
1
vote
2 answers
Write struct to file but wrong value when read back with C++
I write some code to read .wav file and do some algorithm then write to a new .wav file.I use a struct to stand for wav header,before writing the struct to the file,the values in it are all correct,but when I read back ,some values in it changged,I…

马慧超
- 183
- 1
- 10
1
vote
1 answer
Read a JPG file until certain bytes occur
So I'm reading JPG files, and I've finished reading the 'header' data and now I'm onto the actual image data. Thing is, I don't know the size of the image beforehand, so I cannot create an array to read from. What I could do, though, is read from…

Tetramputechture
- 2,911
- 2
- 33
- 48
0
votes
0 answers
How can tzdata.zi file can be identified not as a .zi file Unambiguously?
I've got the tzdata.zi file (appears under the mcr.microsoft.com/dotnet/sdk:6.0 docker image).
From what I know it's a "zone info" file.
Unfortunately it got the same extension of .zi (which is also equivalent to zip file).
.zip file can be…

KaliTheGreat
- 579
- 6
- 17
0
votes
1 answer
What goes into a file header?
I keep wondering "what goes info a file header" and all I can find is "what goes into a C header file" which is not what I want, I want to know what goes into for example a tarball's or an ELF executable's header, anything generic or does it depend…
user16960082
0
votes
1 answer
webm and mp4 hex file header durations
so, there's a "trick" that lets you manipulate video file durations and I would like to know if there is a way to 100% set the exact duration you want without to much trial and error(?). thanks in advance.

wathhr
- 15
- 6
0
votes
0 answers
golang FileHeader.Open() return error no such file or directory
When I am trying to test my upload api, I faced a problem with FileHeader.Open(). I want to mock FileHeader like this:
header := make(map[string][]string)
header["Content-Disposition"] = []string{` form-data; name="file";…

Thuc Nguyen
- 235
- 2
- 8
0
votes
1 answer
Calculate duration of ".ds2" file?
I have a few sample ".ds2" audio files and I need to find the duration of those files. I've done a little bit of research but could not find anything that works for python.
Is there any python package or some other way that I can use to get the…

ArnabC
- 181
- 1
- 3
- 16
0
votes
2 answers
Python read file by bytes until sequence of bytes
How can I read a file in Python byte-by-byte until a specific sequence of bytes is reached?
This must happen all the time with libraries that read specific kinds of files to parse the header, scan for parameters, etc.
As an example: I'm reading…

JeffThompson
- 1,538
- 3
- 24
- 47
0
votes
1 answer
Read bunch of JPGs from container
I have a container file which consists of a header (plain text data) and a bunch of JPGs, divided by few tenth of zeroes.
I currently have some code in Python, which do the following:
skip zero and header on needed;
seeks SOI (0xFF, 0xD8)…

m0nhawk
- 22,980
- 9
- 45
- 73