Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Does any one know how to get the equivilent of an Inode in DOS?
I am trying to write a clean up program that will compare the files last modified date with the current date.

Click here....
http://www.cyberciti.biz/tips/under...
Never Mind though, I think I am going to use...
DIR /OU > temp.txt and just try to use it in a for loop with delimiters.

A better option would be to use a language, such as Perl, Python, VB, that can stat the file to retrieve most of the same info that the Linux stat command returns.

Ok here is what I have...
@echo off dir /OD For /F "tokens=1,2,3,4,5,6,7,8 delims= " %%A in ('DIR /OD') do @( Echo %%A Echo %%F ) pauseBut only some of the files are listing. I have a feeling the the delimiter is not a space but a tab. The problem is I can not figure out how to get ascii characters for the system command in notepad. The Character mapper only allows me to use DEC 22 and up. I need ascii 9 for the tab. Is there any way to do an equivalent of CHR(9) in CMD? I can do it using COPY CON then use the Alt+009 thing but copy con is worse than VI.
Yes, I could do a VB script but I would like to figure it out in CMD.

I don't know where this is headed but it has nothing to do with DOS.
=====================================
Helping others achieve escape felicityM2

the problem with /b is that it does not give me the dates. I need the dates so that I can compare them with the current date and only delete files that are so old.

Date math in CMD is a terrible idea. VBScript is just as native, and it has proper date math.
EDIT: Once I get off my soapbox, I'll probably throw this out there:
for /f "delims=" %%a in ('dir /b /od') do @echo %%~TFa

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |