Multiwfn forum

Multiwfn official website: //www.umsyar.com/multiwfn. Multiwfn forum in Chinese: http://bbs.keinsci.com/wfn

You are not logged in.

#12022-02-04 09:49:11

i.s.ger
Member
Registered: 2020-12-01
Posts: 55

grep shows "Binary file matches"

Dear Tian Lu,

I'm trying to implement some additional features for testing my own theory to Multiwfn.

Sometimes, I use grep for finding descriptions of routines. Unfortunately, if I forget to add -a flag to the grep command, sometimes I see:

Binary file sub.f90 matches Binary file topology.f90 matches Binary file util.f90 matches

It seems to me that the problem is with some specific characters that are not presented in the UTF-8 charset.

Could you please fix the encoding?

Additionally, I noticed that noGUI.sh copies dislin_d-11.0.a to noGUI directory and then it is not used.

Best regards,
Igor

Offline

#22022-02-04 15:43:57

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,777
Website

Re: grep shows "Binary file matches"

Dear Igor,

I don't find the problem of grep you mentioned. For example, in the source code folder, if I run "grep cellmaxxyz *.f90", then the following information will be shown on screen.

PBC.f90:subroutine cellmaxxyz(xmax,ymax,zmax) plot.f90: call cellmaxxyz(xmax,ymax,zmax)

Copying dislin_d-11.0.a to noGUI directory is not harmful.

Best regards,

Tian

Online

#32022-02-04 22:30:05

i.s.ger
Member
Registered: 2020-12-01
Posts: 55

Re: grep shows "Binary file matches"

Dear Tian Lu,

One of example is

$ grep "overlap" util.f90 -i ! *** Overlap *** Binary file util.f90 matches

The fastest way to detect binary files is to run the following command:

$ grep "." * | grep "Binary file"

and it produces (slightly cleaned):

Binary file basin.f90 matches Binary file excittrans.f90 matches Binary file fuzzy.f90 matches Binary file hyper_polar.f90 matches Binary file otherfunc3.f90 matches Binary file population.f90 matches Binary file sub.f90 matches Binary file topology.f90 matches Binary file util.f90 matches

Best regards,
Igor

Offline

#42022-02-04 23:20:07

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,777
Website

Re: grep shows "Binary file matches"

Dear Igor,

I don't have this problem, at least under CentOS 7 for files in source code package of Multiwfn 3.8(dev). These files are plain text files and should not be treated as binary files. I don't know why their status has become binary file on your computer.

Best regards,
Tian

Online

#52022-02-05 05:21:23

i.s.ger
Member
Registered: 2020-12-01
Posts: 55

Re: grep shows "Binary file matches"

Dear Tian Lu,

I see that problem both in Ubuntu in WSL and in Fedora 34 with the source code package of MultiWFN 3.8(dev) from 31 January 2022.
I found that these files have specific charset:

$ file -i * | grep text/plain | grep iso basin.f90: text/plain; charset=iso-8859-1 excittrans.f90: text/plain; charset=iso-8859-1 fuzzy.f90: text/plain; charset=iso-8859-1 hyper_polar.f90: text/plain; charset=iso-8859-1 otherfunc3.f90: text/plain; charset=iso-8859-1 population.f90: text/plain; charset=iso-8859-1 sub.f90: text/plain; charset=iso-8859-1 topology.f90: text/plain; charset=iso-8859-1 util.f90: text/plain; charset=iso-8859-1

But this charset is wrong: the source code has other specific encodings. For example, util.f90 has GBK encoding.

I have attached a patch that changes encodings in problem files to universal UTF-8 charset.

0001-Use-UTF-8-charset.patch.txt

You could apply that using `patch < 0001-Use-UTF-8-charset.patch.txt` in the root directory of MultiWFN.

Best regards,
Igor

Offline

#62022-02-05 14:17:03

sobereva
Tian Lu (Multiwfn developer)
From: Beijing
Registered: 2017-09-11
Posts: 1,777
Website

Re: grep shows "Binary file matches"

Dear Igor

I have updated Multiwfn package, now all files are in UTF-8.

Best regards,

Tian

Online

#72022-02-05 18:59:24

i.s.ger
Member
Registered: 2020-12-01
Posts: 55

Re: grep shows "Binary file matches"

Dear Tian Lu,

Thank you so much!

Best regards,
Igor

Offline

Board footer

Baidu
map