文件操作 - test_desktop.aug
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/augeas/lenses/dist/tests/test_desktop.aug
编辑文件内容
module Test_desktop = let conf = "# A comment [Desktop Entry] Version=1.0 Type=Application Name=Foo Viewer # another comment Comment=The best viewer for Foo objects available! TryExec=fooview Exec=fooview %F Icon=fooview MimeType=image/x-foo; X-KDE-Library=libfooview X-KDE-FactoryName=fooviewfactory X-KDE-ServiceType=FooService " test Desktop.lns get conf = { "#comment" = "A comment" } { "Desktop Entry" { "Version" = "1.0" } { "Type" = "Application" } { "Name" = "Foo Viewer" } { "#comment" = "another comment" } { "Comment" = "The best viewer for Foo objects available!" } { "TryExec" = "fooview" } { "Exec" = "fooview %F" } { "Icon" = "fooview" } { "MimeType" = "image/x-foo;" } { "X-KDE-Library" = "libfooview" } { "X-KDE-FactoryName" = "fooviewfactory" } { "X-KDE-ServiceType" = "FooService" } } (* Entries with square brackets *) test Desktop.lns get "[Desktop Entry] X-GNOME-FullName[ca]=En canadien " = { "Desktop Entry" { "X-GNOME-FullName[ca]" = "En canadien" } } (* Test: Desktop.lns Allow @ in setting (GH issue #92) *) test Desktop.lns get "[Desktop Entry] Name[sr@latin] = foobar\n" = { "Desktop Entry" { "Name[sr@latin]" = "foobar" } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件