My earlier question was triggered by noticing several uses of the null
delimiter when reading from
/proc/*/mounts and/or /proc/mounts
I see now that there is cygwin-3.6.0-dev branch in
https://cygwin.com/git/newlib-cygwin.git
and I am catching up on the log entries

I am aware of other places where we use the null character to delimit
fields - for example /proc/*/cmdline and /proc/*/environ - are there others?
How will this change affect other user scripts that read /proc/mounts ?


On Mon, Mar 3, 2025 at 6:22 AM David Dyck <david.d...@gmail.com> wrote:

> Is the format of /proc/mounts changing from being space delimited to being
> null delimited?
> where can I read more about this change?
>
> On Sun, Mar 2, 2025 at 10:57 PM Jeremy Drake via Cygwin <cygwin@cygwin.com>
> wrote:
>
>>
>> ...
>>
>> declare -a trash
>> readarray -t -d $'\0' trash < <(
>>   LC_CTYPE=C LC_COLLATE=C \
>>   find "${roots[@]}" -maxdepth 1 -iname '$Recycle.Bin' -print0 |
>>   LC_CTYPE=C LC_COLLATE=C \
>>   find -files0-from - -maxdepth 2 \( -name $'.\uDC6D\uDC73\uDC79\uDC73*'
>> -o \
>>                                      -name $'.\uF76D\uF773\uF779\uF773*'
>> -o \
>>                                      -name '.msys*' -o \
>>                                      -name $'.\uDC63\uDC79\uDC67*' -o \
>>                                      -name $'.\uF763\uF779\uF767*' -o \
>>                                      -name '.cyg*' \) -print0)
>> if (( ${#trash[@]} )); then
>>   ls -la "${trash[@]}"
>>   read -r -p "Remove? (y/N) "
>>
>>   if [[ "${REPLY^^}" == "Y" ]]; then
>>     rm -f "${trash[@]}"
>>   fi
>> fi
>>
>>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to