ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47821] New: Touch task doesn't work on Solaris for a file which you do not own
Date Fri, 11 Sep 2009 11:25:55 GMT

           Summary: Touch task doesn't work on Solaris for a file which
                    you do not own
           Product: Ant
           Version: unspecified
          Platform: PC
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks

--- Comment #0 from Johan Corveleyn <> 2009-09-11 04:25:53
PDT ---
>From "man touch" on Solaris 10:

    A user with write access to a file, but who is not the owner
    of the file or a super-user, can change the modification and
    access times of that file only to the current time. Attempts
    to set a specific time with touch will result in an error.

I.e., if you don't own a file, following works in Solaris:
    $ touch thefile   # sets current time -> ok
But the following doesn't:
    $ touch -t 200909111155 thefile   # sets a given time -> not ok

So, I'd expect ant's touch task, without datetime argument, to also work in
this case. However it doesn't. Also, it doesn't signal an error about the
failure to set the modification time.

Looking into the source code, I found that ultimately, the touch task (without
datetime argument) calls thefile.setLastModified(System.currentTimeMillis()).
This is probably equivalent to calling touch with a given datetime argument
(namely the current time), which doesn't work.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message