At 05:42 PM 6/22/2009 +0200, Tarek Ziadé wrote:
Wouldn't it be better to use the native line terminator on the current platform? (someone might want to edit or at least view the file)
Good idea, I'll change that,
As long as the file is always *read* with "U" mode, so that you can't mess it up, especially if the install is to a directory shared between platforms.
The idea of this API is to find out of a distribution "owns" a file, e.g. is the only distribution that uses it, so it can be safely removed.
This could equally well be done by ``owners(path)``, returning a sequence of zero or more items. Any length <> 1 means the file can't be safely removed. Meanwhile, having the data about all the owners of a file would also be useful for tools that just want to inspect a directory's contents, for example, or to detect conflicts and overwrites.
2009/6/22 P.J. Eby <pje@telecommunity.com>:
At 05:42 PM 6/22/2009 +0200, Tarek Ziadé wrote:
Wouldn't it be better to use the native line terminator on the current platform? (someone might want to edit or at least view the file)
Good idea, I'll change that,
As long as the file is always *read* with "U" mode, so that you can't mess it up, especially if the install is to a directory shared between platforms.
Adding that too, thanks;
The idea of this API is to find out of a distribution "owns" a file, e.g. is the only distribution that uses it, so it can be safely removed.
This could equally well be done by ``owners(path)``, returning a sequence of zero or more items. Any length <> 1 means the file can't be safely removed. Meanwhile, having the data about all the owners of a file would also be useful for tools that just want to inspect a directory's contents, for example, or to detect conflicts and overwrites.
that's basically what "get_file_users" does except it's an iterator, roughly that would be : def get_file_owners(path): return list(get_file_users(paths)) So I am wondering if it worth having it.... -- Tarek Ziadé | http://ziade.org
participants (2)
-
P.J. Eby
-
Tarek Ziadé