473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Re: How to bypass Windows 'cooking' the I/O? (One more time, please)II


Dennis Lee Bieber wrote:
On Mon, 07 Jul 2008 01:03:10 -0700, norseman <no******@hughes.net>
declaimed the following in comp.lang.python:
> >
Normal file I/O sequence:

fp = open(target, 'wb')

fp.seek(-1, 2)

fp.write(record)

Except it doesn't do that in Windows. See below.
I wouldn't expect that sequence to work on any system... The "w"
implies "create new file, or truncate existing file to 0-bytes, then
write data to it" -- with no seeking permitted. You must include the "+"
to do seeking, and if you want to retain the existing file contents you
probably need to open with "a+" ("a" for append).

The rest of your situation I won't touch. Other than to wonder why
the situation hasn't hit any of the various database servers which must
be operating in binary mode, and perform lots of seeking... Surely
somewhere out someone else must have encountered a seek crossing an
apparent <cr><eofmark (which isn't a normal Windows sequence anyway --
since Windows uses <cr><lffor EOL, I'd have expected to see a problem
if backing over a <cr><lf><eof>)
=============================================
"I wouldn't expect..." ABSOLUTELY CORRECT. No append because the hex-1A
has to be overwritten. (use r+b) There can be only one of those and it
has to be the last byte of the file. The hex-0D at the beginning of a 32
BYTE segment signifies end of structure definition. The hex-1A double
checks the record count. (standard Ashton-Tate dBASE file)
If someone wants to check it out, appending the hex-1A to each record
and backing up one byte on each write reduces coding complexity and
machine cycles considerably.

"The rest of..." I have seen the answer posted but can't find it. I'm
hoping someone has it, sees this and posts the original solution again.
Or knows how to set things to bypass the nonsense and posts that.

Steve no******@hughes.net

Jul 7 '08 #1
0 790

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Colin Brown | last post by:
Python2.3.2: Running the following receiver and sender code in separate windows under Win2K does not work properly (missed & very delayed transmissions). Under Redhat Linux 9 (where I will be using...
1
by: Robert Hathaway | last post by:
COMP.OBJECT FAQ Version II Beta now Available http://www.objectfaq.com/oofaq2 ================================================== - Latest Important Information on Object Technology - What's New...
13
by: BigDaDDY | last post by:
Um yeah....In case you haven't figured it out, Microsoft sucks. I'm going to be kicked back in my chair eating popcorn and watching football 10 years from now, while all you clowns are scrambling...
3
by: luscus | last post by:
Thanks for all the responses on my first question. Unfortunately the answers I was given were too complicated for my small brain , and neophite condition to understand. So if you could talk down to...
12
by: Joey Powell | last post by:
Re: Original post = Windows forms - how do I get them to render/update properly? from August 22. Okay I am making some progress with being able to use delegates to run my shelled processes on...
4
by: Edwin G. Castro | last post by:
I want to start a process from a C# application. I also want to redirect standard error to standard output so that I can read output from both streams just like I could from a command line. In...
0
by: dicky2283 | last post by:
windows development community please help me im deepak roy , doing my final year undergrad in computer science.... im doing a project - Motion detection and Tracking in vc++( video for...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
0
by: Iain King | last post by:
On Jul 7, 10:18 am, Dennis Lee Bieber <wlfr...@ix.netcom.comwrote: lol @ op not finding the answer to his question in the archives, then being answered again by someone who doesn't let his...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.