Opened 4 years ago

Closed 4 years ago

#61129 closed defect (fixed)

legacy-support: needs lutimes

Reported by: kencu (Ken) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: fhgwright (Fred Wright)
Port: legacy-support

Description

This function is occasionally used, and I believe is fairly simple to implement.

Needed on Tiger only.

Change History (12)

comment:1 Changed 4 years ago by fhgwright (Fred Wright)

Although I haven't dug into it in detail, my impression is that this function is impossible to implement correctly in 10.4, since the capability is missing from the OS. That means that one would have to choose between an "honest" implementation which always fails, and a "speak no evil" implementation that does nothing and reports success. The former would be consistent with what cmake does when the function is unavailable, but I don't know about other uses.

Either approach would be trivial to implement.

comment:2 Changed 4 years ago by kencu (Ken)

Oh, I think it will be much easier than "impossible", like the other 100 functions I've done.

NAME
     lutimes -- set file access and modification times of symlink
Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:3 Changed 4 years ago by kencu (Ken)

I see the call is implemented as an emulated function using setattrlist, and that function exists on Tiger, so probably just copy/paste it out of 10.5's libc implementation.

I already did lchmod a few years ago, and it's probably almost identical <https://github.com/macports/macports-legacy-support/blob/master/src/lchmod.c>

comment:6 Changed 4 years ago by fhgwright (Fred Wright)

OK, I stand corrected.

comment:7 Changed 4 years ago by kencu (Ken)

Fred, would you like to implement it? I sure could use some help. The function is pretty straightforward, it seems, but we would like a test for it too, if possible, to be sure it works.

As you have Tiger, and have skills, I would sure like some help from you on these things, if you have time.

Version 0, edited 4 years ago by kencu (Ken) (next)

comment:8 Changed 4 years ago by fhgwright (Fred Wright)

OK, I could give it a shot. Perhaps not immediately, but it doesn't look hard. IIRC, legacy-support includes a bunch of tests for the functions it implements, so the test framework exists.

comment:9 Changed 4 years ago by kencu (Ken)

Indeed.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:11 Changed 4 years ago by kencu (Ken)

I still need to add some kind of test for it, but it is basically verbatim from libc on Leopard so it better work :>

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:12 Changed 4 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.