ios - 为何大多项目里Podfile 这些要是excitable类型,而不是文本类型
高洛峰
高洛峰 2017-04-17 17:40:26
0
2
380

如图

为何大多开源项目的Podfile等都是unix excitable类型,而不是文本类型。怎么改成这个类型啊??

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
PHPzhong

There is no concept of "type" for files in Linux/unix (not character device files, block device files, etc.), and there is no extension in Windows.
The file type has not changed (the first - that is, ordinary file), it has changed to exec just because the permissions have changed

-rw-r--r-- 1 Jason staff 147 Feb 28 15:00 Podfile

becomes

-rwxr-xr-x@ 1 Jason staff 254 Feb 24 07:05 Podfile

A brief explanation: x means executable, rw means reading and writing as the name suggests.
Three groups represent owner group other.
MAC Many files will have the x attribute added inexplicably after being downloaded from the Internet.
You can try to use the command in the terminal to modify it to the original permissions. Podfile should be -rw-r--r--.
The following commands can be modified:

$ chmod 644 file name

There may be some risks in modifying file permissions. I modified it and found no problems.

We will deal with the issue of @ below


The file permissions may end up with . and @ representing acl and extensible metadata attributes@: just some additional information, such as the download link to describe the file, etc.
Most likely in the Podfile is

com.apple.quarantine: xxx...;Safari;xxx-xxx...

The meaning is obvious. If you downloaded it from Safari, you can use the following command to delete it.

  • represents all files, you can also specify the file name

xattr -d com.apple.quarantine *

Now the file looks exactly like the one you created.

If there is a lot of description information, the command does not seem to provide parameters to delete all. But it can be removed with a few lines of shell script + regular expressions. I don't think it's much so I won't provide it.
Specific usage of chmod
https://zh.wikipedia.org/wiki/Chmod

洪涛

I don’t know, but it can be opened, such as Atom

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template