#10567: wxFileName::SetTimes doesn't set access time correctly
----------------------------------------------+-----------------------------
Reporter: talon_karrde | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxMSW | Version: 2.8.9
Keywords: wxFileName::SetTimes access time | Blockedby:
Patch: 0 | Blocking:
----------------------------------------------+-----------------------------
If you try to set a specific time as an access time for a file using
wxFileName::SetTimes, the current time will actually be set instead. This
is caused by the GENERIC_WRITE access flags used to open a handle to the
file, the access time is correctly set if only FILE_WRITE_ATTRIBUTES is
used. The problem is that this access flag is used in wxFileHandle's ctor
which is meant to be reused, so I can't just modify it, perhaps some of
the developers should decide how to resolve this issue.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/10567>
#10567: wxFileName::SetTimes doesn't set access time correctly
---------------------------+------------------------------------------------
Reporter: talon_karrde | Owner: vadz
Type: defect | Status: accepted
Priority: normal | Milestone:
Component: wxMSW | Version: 2.8.9
Resolution: | Keywords: wxFileName::SetTimes access time
Blockedby: | Patch: 0
Blocking: |
---------------------------+------------------------------------------------
Changes (by vadz):
* owner: => vadz
* status: new => accepted
Comment:
AFAICS wxFileHandle is only used in GetSize() and it should probably be
enough to use `FILE_READ_ATTRIBUTES` there too, could you please test it?
IOW replacing `GENERIC_READ/WRITE` with `FILE_READ/WRITE_ATTRIBUTES`
should work AFAICS. And it definitely must work for WRITE, anyhow.
TIA!
--
Ticket URL: <http://trac.wxwidgets.org/ticket/10567#comment:1>
#10567: wxFileName::SetTimes doesn't set access time correctly
---------------------------+------------------------------------------------
Reporter: talon_karrde | Owner: vadz
Type: defect | Status: accepted
Priority: normal | Milestone:
Component: wxMSW | Version: 2.9-svn
Resolution: | Keywords: wxFileName::SetTimes access time
Blockedby: | Patch: 1
Blocking: |
---------------------------+------------------------------------------------
Changes (by talon_karrde):
* version: 2.8.9 => 2.9-svn
* patch: 0 => 1
Comment:
I've attached a patch that fixes the issue, decided to rename the open
modes to ReadAttr and WriteAttr so that regular read and write can be
added later if needed.
The patch is made against the trunk, I hope I've gotten the Version field
right.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/10567#comment:2>
#10567: wxFileName::SetTimes doesn't set access time correctly
----------------------------------------------+-----------------------------
Reporter: talon_karrde | Owner: vadz
Type: defect | Status: accepted
Priority: normal | Milestone:
Component: wxMSW | Version: 2.9-svn
Keywords: wxFileName::SetTimes access time | Blockedby:
Patch: 1 | Blocking:
----------------------------------------------+-----------------------------
Comment(by vadz):
Thanks for the patch, will apply soon.
BTW (and sorry if I had already asked...) I didn't credit you in the
changelog because I don't know how you wish to be mentioned. Really as
[http://starwars.wikia.com/wiki/Talon_Karrde Talon Karrde]?
--
Ticket URL: <http://trac.wxwidgets.org/ticket/10567#comment:3>
#10567: wxFileName::SetTimes doesn't set access time correctly
---------------------------+------------------------------------------------
Reporter: talon_karrde | Owner: vadz
Type: defect | Status: closed
Priority: normal | Milestone:
Component: wxMSW | Version: 2.9-svn
Resolution: fixed | Keywords: wxFileName::SetTimes access time
Blockedby: | Patch: 1
Blocking: |
---------------------------+------------------------------------------------
Changes (by VZ):
* status: accepted => closed
* resolution: => fixed
Comment:
(In [62705]) Don't change file access time implicitly when setting it
explicitly.
wxFileHandle helper class used in wxFileName::SetTimes() under MSW
modified
the file access time by setting it to the current time because it opened
the
file in a wrong mode.
Closes #10567.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/10567#comment:4>
#10567: wxFileName::SetTimes doesn't set access time correctly
---------------------------+------------------------------------------------
Reporter: talon_karrde | Owner: vadz
Type: defect | Status: closed
Priority: normal | Milestone:
Component: wxMSW | Version: 2.9-svn
Resolution: fixed | Keywords: wxFileName::SetTimes access time
Blockedby: | Patch: 1
Blocking: |
---------------------------+------------------------------------------------
Comment(by talon_karrde):
Why, what's wrong with Talon Karrde? :)
Actually, as you might have already guessed, my real name is Neno Ganchev,
and I should probably be mentioned under my real name. The account name is
a leftover from the days when I used nicknames for all my accounts,
sourceforge included, and I already have some history associated with it
and don't want to lose it by creating a new account. I've recently
discovered that sourceforge allows you to specify another name under which
you are visible to the community, while using the account name for
authentication purposes only. Is it possible to do such a thing with trac,
or rename an account name without losing its history? Thanks in advance
for any information on this.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/10567#comment:5>
#10567: wxFileName::SetTimes doesn't set access time correctly
---------------------------+------------------------------------------------
Reporter: talon_karrde | Owner: vadz
Type: defect | Status: closed
Priority: normal | Milestone:
Component: wxMSW | Version: 2.9-svn
Resolution: fixed | Keywords: wxFileName::SetTimes access time
Blockedby: | Patch: 1
Blocking: |
---------------------------+------------------------------------------------
Comment(by vadz):
I don't think it's possible to rename an account but I could be wrong. I'm
not a big Trac expert, unfortunately.
--
Ticket URL: <http://trac.wxwidgets.org/ticket/10567#comment:6>