473,394 Members | 1,697 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,394 software developers and data experts.

Getting file size from full file path and reading ID3 tags??

I have the full file path of a file stored as a string and I'de like
to get the file size in bytes.

What is the most efficient way of doing this with a static method from
the File class or something like I've been using to move/copy files
around? I know this can be done by creating a FileInfo object, am I
wrong in thinking creating the object just to check the size is
unneccesary and unneficient?

I'de also like to read the ID3 tags of MP3 files, how can I go about
doing this?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #1
4 2268
If you are going to be reading ID3 tags then you need to open
the file anyway. The Length property of a FileStream should
work fine. If you are reading ID3v1 tags, these are quite easy
and they exist as the last 128 bytes in the file. You can read
out the requisite fields using a BinaryReader.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"supster" <pr*********@hotmail-dot-com.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
I have the full file path of a file stored as a string and I'de like
to get the file size in bytes.

What is the most efficient way of doing this with a static method from
the File class or something like I've been using to move/copy files
around? I know this can be done by creating a FileInfo object, am I
wrong in thinking creating the object just to check the size is
unneccesary and unneficient?

I'de also like to read the ID3 tags of MP3 files, how can I go about
doing this?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 16 '05 #2
Opa
Hi

Someone has created a library that allow you manipulate mp3 files
Check it out at

http://home.fuse.net/honnert/hundred/?UltraID3Li

I have used the library and it is fantastic. It has save me a lot of time.
Nov 16 '05 #3
I was actually hoping to avoid opening a stream to each file.

Looking around on google I found this:
http://www.thecodeproject.com/csharp...3TagReader.asp

Windows is able to display information read from ID3 tags when viewing
files in detailed list format, this seems to grab the information
that way.

This will read ID3v2 tags if available, if not ID3v1 tags. This seems
to be the best way to do it so I don't have to manually parse out the
data and fumble around checking if v1 or v2 tags exist. Any
thoughts?

Thanks
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #4
Explorer still opens the streams and then possibly caches the information
for future use. However, if you are looking for a generic V1/V2 solution
then yes, you probably want to use an OS service.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"supster" <pr*********@hotmail-dot-com.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
I was actually hoping to avoid opening a stream to each file.

Looking around on google I found this:
http://www.thecodeproject.com/csharp...3TagReader.asp

Windows is able to display information read from ID3 tags when viewing
files in detailed list format, this seems to grab the information
that way.

This will read ID3v2 tags if available, if not ID3v1 tags. This seems
to be the best way to do it so I don't have to manually parse out the
data and fumble around checking if v1 or v2 tags exist. Any
thoughts?

Thanks
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 16 '05 #5

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

Similar topics

4
by: francisl | last post by:
How can we get a full directory size (sum of all his data)? like when we type `du -sh mydir` Because os.path.getsize('mydir') only give the size of the directory physical representation on the...
12
by: Xah Lee | last post by:
would anyone like to translate the following perl script to Python or Scheme (scsh)? the file takes a inpath, and report all html files in it above certain size. (counting inline images) also...
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....
2
by: P of Dhump | last post by:
Hi, I am getting some data from a .csv file through an aspx page. The total no of records are 744 while i'm getting 1500. I couldn't really figure it out. I'll write the code below. Dim...
0
by: ruju00 | last post by:
I am getting an error in Login() method of the following class FtpConnection public class FtpConnection { public class FtpException : Exception { public FtpException(string message) :...
0
by: smanisankar | last post by:
hi, the following is the full page code for uploading a file to server. since i got no idea to overwrite the file, i want delete the file if the file is already uploaded. i got the folder name...
3
by: Vibhu | last post by:
Hello All, I have a input box on the HTML page with the type set to file. What I want is that when the value changes in the file textbox, it should give me the full file path. I have even tried...
3
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and...
13
by: DH | last post by:
Hi, I'm trying to strip the html and other useless junk from a html page.. Id like to create something like an automated text editor, where it takes the keywords from a txt file and removes them...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.