Skip to content

Commit

Permalink
Add condition to detect miss case
Browse files Browse the repository at this point in the history
  • Loading branch information
dmknght authored Oct 14, 2024
1 parent c2528be commit 03c49c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/research/find_hidden_file.nim
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ proc find_hidden_files(find_dir: string) =
# From output of d_name, last node in folder that has so many nodes will has d_reclen > actual value
# This is a fast method to check this logic happen.
# Need to check carefully with multiple systems because input value is unpredictable
wrong_reclen = ($cast[cstring](addr(r_dir.d_name[r_dir.d_reclen - 1]))).endswith(save_node_name)
let tmp_string_from_chunk = $cast[cstring](addr(r_dir.d_name[r_dir.d_reclen - 1]))
wrong_reclen = tmp_string_from_chunk.endswith(save_node_name) and tmp_string_from_chunk != save_node_name

discard f_dir.closedir()

Expand Down

0 comments on commit 03c49c5

Please sign in to comment.