Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dir showing date, path, filename, size

Status
Not open for further replies.

mflancour

MIS
Apr 23, 2002
379
US
I have a stored proc which checks a directory for files and sends out an email if any are there. I'm updating it to look at subfolders now as well, and would also like to change it so it only shows files older than 1 day. Everything is working except for the files contained in subfolders, I can't find a dir command that will show the entire path, which i need.

Currently using
dir /s
 
are you using exec xp_dirtree?

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
xp_cmdshell...
if you know how I can do it with another command just let me know how.
 
There is an undocumented extened proc named xp_dirtree, I've never used it but it should work well in this case. Try to google it.

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
ya, tried that, but that gives even less information. I need filename
datemodified or created
fullpath
size
 
You can get file information (dates, size, etc) by using the xp_getfiledetails procedure. This procedure only works in SQL 7 and SQL 2000. It was removed in SQL 2005 for some reason. Hopefully it will be returned in SQL 2007 as I've requested.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
problem with that is that I'd have to have the full path to plug it into getfiledetails, which I don't. I have only the starting folder and no info on subfolders. Plus, our conversion to 2005 is in just a few months, so still wouldn't work.
 
Any one know anything about "ls"? it's a unix command apparently that you can call using cygwin. I can't seem to find a combinations of commands to give me what I want though.
 
Do a google for "ls man pages" that should give you all the paramaters.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Thanks mrdenny. I used command prompt to pull up the manual and there are tons of params. there must be something to give me the path, but so far no luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top