gpt4 book ai didi

c++ - 在 MAC OS X 上创建桌面快捷方式(如 .desktop 在 linux 上)

转载 作者:太空宇宙 更新时间:2023-11-04 11:04:52 29 4
gpt4 key购买 nike

如何仅使用 C++ 在 MAC OSX 中创建桌面快捷方式。

在 linux 中,我可以使用 .desktop 文件来完成

[Desktop Entry]  
Version=1.0
Name=Eclipse
Exec=/usr/local/bin/eclipse

最佳答案

正如@dreamlax 所提到的,这是您要创建的别名;至少,这是当您右键单击某个项目时 UI 提供的内容:-

enter image description here

如果您使用终端并创建指向桌面上某个项目的符号链接(symbolic link),您会看到它创建了一个相似“别名”。因此,您可以做的是通过调用 ln function 创建指向源项目的符号链接(symbolic link)。 ,可能与 symlink 相同函数调用。

请注意,使用 UI 创建的别名与 ln 创建的别名并不完全相同,正如您在链接到 pkg(安装程序)文件时所看到的那样。如果您使用 ' file '命令上二。使用 ln,创建的链接被标识为“xar archive - version 1”,而 UI 别名创建一个名为“alias: data”的文件。

但是,就功能而言,两者都应该作为一种在桌面上放置指向另一个位置的项目的链接的方式。

最后,注意this distinction在确定 ln 是否适合您的情况之前,在 POSIX ln 和别名之间:-

[alias] is similar to the Unix symbolic link, but with the distinction of working even if the target file moves to another location on the same disk

关于c++ - 在 MAC OS X 上创建桌面快捷方式(如 .desktop 在 linux 上),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25685275/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com