[Python-Dev] Python 2.5.1

Kristján Valur Jónsson kristjan at ccpgames.com
Tue May 1 15:50:30 CEST 2007

Hm, I fail to see the importance of a special regression test for that
peculiar file then with its special magical OS properties.  Why not focus
our attention on real, user generated files?.

-----Original Message-----

Wow, I'm very sorry, I didn't realize how much special pagefile.sys
and hiberfil.sys are. As it turns out, even if you create a file with
no sharing allowed, you can still open it with backup semantics in
other processes, and thus can use GetFileAttributesEx, GetFileTime,
etc. The file pagefile.sys seems almost magical then, I don't
understand how it's opened to behave like that. The difference is also
immediately visible if you try to open Properties of pagefile.sys, you
won't even see Security tab there (even when I create file
something.txt and then remove all ACLs, including SYSTEM, I can't
access the file, but I can see Security tab and can grant myself
permissions back), it looks like all kinds of opening that file are
denied. Maybe this is a special security feature, so that no process
could access swapped pages (otherwise it could be possible with backup
semantics). Thus you can't access the file itself, you can only access
containing directory.

> So I guess we need continue using pagefile.sys as a test case.

Seems to be true, it's just maybe it shouldn't be hardcoded to C:\
There's REG_MULTI_SZ PagingFiles in
"HKLM\System\CurrentControlSet\Control\Session Manager\Memory
Management", btw. The format seems to be "filename minmbsize
maxmbsize" for every line.

More information about the Python-Dev mailing list