473,624 Members | 2,612 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strange file.write() behavior on windows: $ConvertToNonre sident, $ReplaceAttribu te2

while taking some rough disk performance measures on windows machines,
and snooping with FileMon, i've noticed some odd behavior

here's the little nul-writer i'm running:
def writeTest(nBloc ks, blockSize):
"""write nBlocks*blockSi ze nuls to a file"""
f = open("writeTest .out", "wb")
nulBlock = '\0'*blockSize
while nBlocks:
f.write(nulBloc k)
nBlocks -= 1
f.close()

when i invoke this with a blockSize of 64K or less, no surprises.
here's a row of FileMon output for the 64K block size:
2:44:48 PM python.exe:3064 WRITE C:\writeTest.ou t SUCCESS Offset:
214106112 Length: 65536

when i invoke this with larger blocksizes (say, 655360), FileMon output
looks like this:
2:37:46 PM python.exe:3064 WRITE C:\writeTest.ou t Offset: 140902400
Length: 655360
2:37:46 PM python.exe:3064 WRITE C:\$ReplaceAttr ibute2 SUCCESS Offset:
140902400 Length: 65536
....(the $ReplaceAttribu te2 line repeats several times, writing 65536
and advancing the offset by 65536 each time)

sometimes, depending on the phase of the moon, instead of
$ReplaceAttribu te2 the write goes to $ConvertToNonre sident. within a
single run of writeTest the write always goes to the same one,
whichever one that is. these runs are always slower (sometimes greatly)
than writing the same with 64K blocks, even though many fewer
file.write()'s are being issued because of the larger block size.

finally, where you'd expect an even 10 of the WRITE
C:\$ReplaceAttr ibute2 lines per WRITE C:\writeTest.ou t lines in the
example above, instead FileMon reports 8 lines for the first, 6 for the
second, 8 for the third, 6 for the fourth, etc... i've no idea if this
means FileMon is missing messages, but this pattern is absolutely
consistent across every run i've made, on both xp and win2k3 server
machines.

a look at the python fileobject.c source shed no light for me, anyone
know what could be going on? the "equivalent " c version of writeTest
using fwrite() shows a succession of 1K blocks writing to the named
file (even when fwrite is given 64K blocks), and no mysterious
$ReplaceAttribu te2 lines

-- w

Nov 22 '05 #1
4 6851
This is really just a snide joke at the expense of Microsoft, but have you
checked the MSDN documentation about ConvertToNonres ident or ReplaceAttribut e2?

Your search - site:msdn.micro soft.com ConvertToNonres ident OR
ReplaceAttribut e2 - did not match any documents.
-- google.com

Internally, Python also simply calls fwrite(). Are you using the same C
runtime for both sets of tests?

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDe8alJd0 1MZaTXX0RAjpDAK CPpv7J3sJ21Yszx DjknKG0dEvjRwCf QfP5
oU/o2FKjl0cDqqr3dD ufeyU=
=C/YG
-----END PGP SIGNATURE-----

Nov 22 '05 #2
This is really just a snide joke at the expense of Microsoft, but have you
checked the MSDN documentation about ConvertToNonres ident or ReplaceAttribut e2?

Your search - site:msdn.micro soft.com ConvertToNonres ident OR
ReplaceAttribut e2 - did not match any documents.
-- google.com

Internally, Python also simply calls fwrite(). Are you using the same C
runtime for both sets of tests?

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDe8alJd0 1MZaTXX0RAjpDAK CPpv7J3sJ21Yszx DjknKG0dEvjRwCf QfP5
oU/o2FKjl0cDqqr3dD ufeyU=
=C/YG
-----END PGP SIGNATURE-----

Nov 22 '05 #3
"welch" <we************ ***@gmail.com> wrote:
while taking some rough disk performance measures on windows machines,
and snooping with FileMon, i've noticed some odd behavior sometimes, depending on the phase of the moon, instead of
$ReplaceAttribu te2 the write goes to $ConvertToNonre sident. within a
single run of writeTest the write always goes to the same one,
whichever one that is. these runs are always slower (sometimes greatly)
than writing the same with 64K blocks, even though many fewer
file.write()'s are being issued because of the larger block size.

finally, where you'd expect an even 10 of the WRITE
C:\$ReplaceAttr ibute2 lines per WRITE C:\writeTest.ou t lines in the
example above, instead FileMon reports 8 lines for the first, 6 for the
second, 8 for the third, 6 for the fourth, etc... i've no idea if this
means FileMon is missing messages, but this pattern is absolutely
consistent across every run i've made, on both xp and win2k3 server
machines.

a look at the python fileobject.c source shed no light for me, anyone
know what could be going on? the "equivalent " c version of writeTest
using fwrite() shows a succession of 1K blocks writing to the named
file (even when fwrite is given 64K blocks), and no mysterious
$ReplaceAttribu te2 lines


you're seeing activities by the Windows caching system (c:\$ stuff is various
NTFS data streams). unless you're writing low-level drivers, you don't really
have to care about what it does, and when it does what...

</F>

Nov 22 '05 #4
"welch" <we************ ***@gmail.com> wrote:
while taking some rough disk performance measures on windows machines,
and snooping with FileMon, i've noticed some odd behavior sometimes, depending on the phase of the moon, instead of
$ReplaceAttribu te2 the write goes to $ConvertToNonre sident. within a
single run of writeTest the write always goes to the same one,
whichever one that is. these runs are always slower (sometimes greatly)
than writing the same with 64K blocks, even though many fewer
file.write()'s are being issued because of the larger block size.

finally, where you'd expect an even 10 of the WRITE
C:\$ReplaceAttr ibute2 lines per WRITE C:\writeTest.ou t lines in the
example above, instead FileMon reports 8 lines for the first, 6 for the
second, 8 for the third, 6 for the fourth, etc... i've no idea if this
means FileMon is missing messages, but this pattern is absolutely
consistent across every run i've made, on both xp and win2k3 server
machines.

a look at the python fileobject.c source shed no light for me, anyone
know what could be going on? the "equivalent " c version of writeTest
using fwrite() shows a succession of 1K blocks writing to the named
file (even when fwrite is given 64K blocks), and no mysterious
$ReplaceAttribu te2 lines


you're seeing activities by the Windows caching system (c:\$ stuff is various
NTFS data streams). unless you're writing low-level drivers, you don't really
have to care about what it does, and when it does what...

</F>

Nov 22 '05 #5

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

Similar topics

6
2239
by: Anders Eriksson | last post by:
Hello! I'm using ActivePython 2.3.2 build 232 on Windows 2000 and I have noticed a strange behavior in PythonWin IDE (win32all build 163) I'm from Sweden and we have a couple of letters in our alphabet that isn't part of ASCII and the strangeness is about one of them When I use the letter ĺ (&aring;) then the next character is eaten! Then when I enter the next character (the second after ĺ) the last one appears.
4
6083
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my application (VB.NET) will start a process, redirect its stdout and capture that process' output, displaying it in a window. I've written a component for this, and a test application for the component. It allows me to specify a command to execute,...
3
3476
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or less would display, but those close to 300 pixels/inch or greater would not (MS Access cannot recognize the file format xxx.jpg). The larger, original images were scanned and saved as .bmp (at 300 dpi producing a 15MB file). Then the images were...
6
8519
by: leonecla | last post by:
Hi everybody, I'm facing a very very strange problem with a very very simple C program... My goal should be to write to a binary file some numbers (integers), each one represented as a sequence of 32 bit. I made this stupid trial code: --------------------------------------------- FILE *fout;
15
4744
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
3
2333
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table using ADO. I'm getting sometimes correct values, sometimes null values (when I know I pass a valid default value) and other times multiple values! I know what the values coming over are because I do a response.write to see it before the error...
6
2258
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to the same method (aka delegate?). I use the Tag property within this method to determine what user action is taking place. Very simple: When adding toolbar button: tbButton.Click += new...
17
8018
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: I am trying to use the SaveFileDialog class to get a filename, which is subsequently opened for writing (write access, read sharing, but using read/write sharing doesn't make the problem go away anyway). Sometimes, on the statement where I...
10
2330
by: John Kraft | last post by:
Hello all, I'm experiencing some, imo, strange behavior with the StreamReader object I am using in the code below. Summary is that I am downloading a file from a website and saving it to disk for further parsing. I know, I could use the WebClient and it would be easier, but I don't have the flexibility I want with it. This code appears to work exactly the way I want unless the user cancels the the background operation. In that...
0
8179
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8631
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8341
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8490
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4184
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.