gpt4 book ai didi

eiffel - 如何遍历 Eiffel 的目录?

转载 作者:行者123 更新时间:2023-12-02 07:51:47 25 4
gpt4 key购买 nike

简单

如何使用 eiffel 获取目录内的文件列表?

最佳答案

例如:


class CARPETAS

creation
make

feature {NONE}

make is
local
directory: DIRECTORY
path: STRING
do
path := "." -- Current directory
!!directory.scan_with(path)
list_directory(directory)
end

list_directory(directory: DIRECTORY) is
local
i: INTEGER
do
std_output.put_string("Content of " + directory.path + "%N")
from
i := directory.lower
until
i > directory.upper
loop
std_output.put_string("%T" + directory.name(i) + "%N")
i := i + 1
end
end
end

关于eiffel - 如何遍历 Eiffel 的目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3411196/

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