Opened 16 years ago
Last modified 14 years ago
#201 assigned enhancement
It is not possible to delete/rename open files
Reported by: | Yuri Dario | Owned by: | bird |
---|---|---|---|
Priority: | normal | Milestone: | libc-0.7 |
Component: | libc-backend | Version: | |
Severity: | normal | Keywords: | unlink |
Cc: |
Description
It is necessary to workaround this bug/feature, because most programs logging to disk do not provide a log rotation since they rely on unix feature to rename/delete files when close is called (usually a cron task issue a rename log followed by a SIG_HUP to daemon).
This is an OS/2 known limit, but I suggest a workaround for klibc-only based programs: since klibc has a global table of open files, just add a proper field to remember the pending rename/delete operation; when file is closed, just execute the action. It will not work for non-klibc programs, but this is acceptable (at least for me).
Change History (6)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Meanwhile the code has been written as a static library, available here:
http://web.os2power.com/yuri/URPO
as LGPL source code (and binaries).
comment:3 by , 14 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:4 by , 14 years ago
Keywords: | unlink added |
---|---|
Milestone: | → libc-0.7 |
Resolution: | wontfix |
Status: | closed → reopened |
comment:5 by , 14 years ago
Status: | reopened → new |
---|
comment:6 by , 14 years ago
Status: | new → assigned |
---|
A solution that doesn't solve the whole unlink/rename thing is not going into libc proper, it can be supplied via additional libs and used by those who want knowing the restrictions.
It shouldn't be too difficult to come up with a solution that solves the whole problem. Implementing it might require a wee bit effort of course. My idea is to make use of EAs that indicates whether a file is unlink or really rename, renaming being done via hidden symlink like files. Cleaning up should be attempted on every close of a file involved. Transitions need to be defined and to form a kind of state machine. readdir will require filtering.