do trailing spaces cause (file? x) to return nil?
Posted: Wed Jun 10, 2015 3:19 am
I have a few directories full of files named with trailing spaces. I thought this would remove the trailing spaces, but it only returns nil.
I tried debugging by using (trace true) with the following code:
The "." and ".." files in the directory are files, but the other files return "nil". Does the trailing space prevent newLISP from recognizing the file as a file? Is there something else that may be causing the error (e.g. bad code on my part)? Thanks!
Code: Select all
(dolist (x (directory path))
(rename-file x (trim x))
)
Code: Select all
(dolist (x (directory path))
(file? x))
)