473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

File information??

Is there a way to get the file size and modified date of a file?
Jul 18 '05 #1
3 12716
Hello, Stan!
You wrote on Fri, 04 Jul 2003 05:59:10 GMT:

SC> Is there a way to get the file size and modified date of a file?

os.stat()

=========Beginning of the citation==============
import os,glob

a=glob.glob('c:\\*')[0]
print os.stat(a)[6],os.stat(a)[8]

=========The end of the citation================

With best regards, Egor Bolonev. E-mail: eb******@rol.ru [ru eo en]

Jul 18 '05 #2
Thanks! I'll try that.
"Egor Bolonev" <eb******@rol.ru> wrote in message
news:be**********@news.rol.ru...
Hello, Stan!
You wrote on Fri, 04 Jul 2003 05:59:10 GMT:

SC> Is there a way to get the file size and modified date of a file?

os.stat()

=========Beginning of the citation==============
import os,glob

a=glob.glob('c:\\*')[0]
print os.stat(a)[6],os.stat(a)[8]

=========The end of the citation================

With best regards, Egor Bolonev. E-mail: eb******@rol.ru [ru eo en]

Jul 18 '05 #3
Thanks.....That did it... Just what I was looking for!

Stan
"Ian Bicking" <ia**@colorstudy.com> wrote in message
news:ma*********************************@python.or g...
On Fri, 2003-07-04 at 00:59, Stan Cook wrote:
Is there a way to get the file size and modified date of a file?


os.stat(filename).st_size and os.stat(filename).st_mtime

Ian

Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: shiva | last post by:
Inorder to handle large files over 100 MB, is there a way in dotnet to open only certain bytes of the file by buffer ? It is shaky if the entire file is opened and splitted. Instead is there a...
3
by: Krish | last post by:
I have requirement, that i get one big chunk of text file. This text file will have has information, that on finding "****End of Information****", i have to split them individual text file with our...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
7
by: Mark | last post by:
Hello, I have researched and tried every thing I have found on the web, in groups and MS KB articles. Here is what I have. I have a Windows 2000 Domain Controller all service packs and...
8
by: Peter | last post by:
I'm trying to write a proceedure that will delete a file completely off a hardrive. I just don't want to kill the file. I want to rewrite over the data with 1's and 0's 8 times. Anyone have an...
9
by: Stacey | last post by:
I am using Visual Studio 2005, creating a VB.NET program. I am have created a settings file and two settings in the file. The section that it created in my app.config is below. I can not figure...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
7
by: sprash | last post by:
Newbie question: I'm trying to determine if a file physically exists regardless of the permissions on it Using File.Exists() returns false if it physically exists but the process does not...
0
ADezii
by: ADezii | last post by:
Rather than using CurrentProject.Connection or entering your own Connection information, ADO supports storing Connection information in an external file called a Data Link File (which normally has a...
0
by: Filemaxor | last post by:
I have gotten my code to be able to allow people to add new text to a .txt document and able to call up files so the user can see whats in it. The problem i'm having is getting the for loop to work...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.