Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > stripping the first byte from a binary file

Reply
Thread Tools

stripping the first byte from a binary file

 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      07-11-2007
Alex Popescu wrote:

> On Jul 11, 4:15 pm, "Diez B. Roggisch" <(E-Mail Removed)> wrote:
>> > Forgive my newbie ignorance, but I am wondering why the other method
>> > would not work? I mean it may not be very safe,
>> > but I guess it may perform a lot better, than having to read the whole
>> > file just to cut out the first byte.

>>
>> Because seeking is not moving? Shifting data bytewise isn't something
>> that is supported by the underlying OS filesystems, and thus not
>> supported. But replacing bytes with others is. Which seek is for.
>>
>> Diez

>
> As far as I know seek is just about positioning and nothing else.


It is.

> So, in fact the problem boils down to os support for deleting a bytes.


Which there isn't, as I and several others pointed out. And "replacing" is
not removing.

Diez
 
Reply With Quote
 
 
 
 
Alex Popescu
Guest
Posts: n/a
 
      07-11-2007
On Jul 11, 7:45 pm, "Diez B. Roggisch" <(E-Mail Removed)> wrote:
> Alex Popescu wrote:
> > On Jul 11, 4:15 pm, "Diez B. Roggisch" <(E-Mail Removed)> wrote:
> >> > Forgive my newbie ignorance, but I am wondering why the other method
> >> > would not work? I mean it may not be very safe,
> >> > but I guess it may perform a lot better, than having to read the whole
> >> > file just to cut out the first byte.

>
> >> Because seeking is not moving? Shifting data bytewise isn't something
> >> that is supported by the underlying OS filesystems, and thus not
> >> supported. But replacing bytes with others is. Which seek is for.

>
> >> Diez

>
> > As far as I know seek is just about positioning and nothing else.

>
> It is.
>
> > So, in fact the problem boils down to os support for deleting a bytes.

>
> Which there isn't, as I and several others pointed out. And "replacing" is
> not removing.
>
> Diez


I do agree with your last statement (and it was my mistake to consider
replacing a possible way to remove). Just wanted to
clarify that seek is only for positioning.

bests,

../alex
--
..w( the_mindstorm )p.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
read text file byte by byte daved170 Python 30 12-16-2009 09:54 PM
convert form byte[4] to Int32 while retaining the binary value of the byte array jeff@foundrymusic.com C++ 20 09-07-2009 08:54 PM
Stripping specific bytes of a file without opening the entire file... balgach@gmail.com C++ 7 02-06-2005 04:11 PM
Search for byte pattern in a binary file. Ryan Tan via JavaKB.com Java 20 11-19-2004 08:41 AM
byte B= 0x0F;// Hex. representaion --> How byte B=0001111 // Binary rep.? C++ 2 07-26-2004 08:08 PM



Advertisments