Search
Project
General
Profile
Home
Projects
Help
Sign in
Register
Search
:
Ruby
All Projects
Ruby
Overview
Activity
Roadmap
Issues
Repository
Download (399 Bytes)
Feature #22604
» repro_find_lstat.rb
dug (Doug E)
, 11/18/2026 11:00 PM
require
"find"
require
"tmpdir"
calls
=
0
File
.
singleton_class
.
prepend
(
Module
.
new
{
define_method
(
:lstat
)
{
|
path
|
calls
+=
1
;
super
(
path
)
}
})
Dir
.
mktmpdir
do
|
dir
|
3
.
times
{
|
i
|
File
.
write
(
File
.
join
(
dir
,
"file
#{
i
}
"
),
"x"
*
i
)
}
entries
=
size
=
0
Find
.
find
(
dir
)
do
|
path
|
entries
+=
1
size
+=
File
.
lstat
(
path
).
size
end
puts
"
#{
entries
}
entries,
#{
calls
}
File.lstat calls"
end
« Previous
1
2
3
Next »
(3-3/3)
Loading...