可移植的方式显示当前目录的内容 [英] Portable way to show the contents of the current directory

查看:50
本文介绍了可移植的方式显示当前目录的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在重新启动案例期间为缺少输入文件的用户提供其他信息。

I want to provide additional information to the user during a restart-case for missing input files.

是否存在一种可移植的方式来打印当前目录中的文件?

Is there a portable way to print out the files in the current directory?

推荐答案

请查看文件系统概念,特别是在 目录

Please take a look at File System Concepts, specifically at directory.

例如,


  • 使用(目录〜/ *)获取您家中的文件列表,

  • 使用(目录〜/ * /)以获得您家中目录的列表,

  • (目录〜/ ** / *)可获得列表您家中所有子目录中的所有文件

  • use (directory "~/*") to get the list of files in your home,
  • use (directory "~/*/") to get the list of directories in your home,
  • and (directory "~/**/*") to get the list of all files in all subdirectoris in your home

请注意,目录特定于实现的参数,例如:full

Note that directory may take implementation-specific arguments like :full.

如果您使用的是 asdf (您应该!),您可能想要看看 uiop

If you are using asdf (you should!), you might want to take a look at uiop which comes with it.

PS。如果您的实现不支持路径名中的来引用主目录,则可以使用 user-homedir-pathname

PS. If your implementation does not support ~ in pathname to refer to the home directory, you can use user-homedir-pathname instead.

这篇关于可移植的方式显示当前目录的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆