Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How do I create an empty mp3 or jpg of a specific size?

How do I create an empty mp3 or jpg of a specific size?
Thread Tools
Fresh-Faced Recruit
Join Date: Feb 2011
Status: Offline
Reply With Quote
Feb 5, 2011, 02:28 PM
 
Hi All,

I am new to the forum so apologies if this has already been answered. I couldn't find an answer on Google or here :-(

I have a need to generate either an mp3 or jpg file of a specific size (250/500/1000 MB) for test purposes. Unfortunately I have no idea how to do this easily.

If anyone can offer I way to do this without additional software (maybe using the command line and then adding some kind of header to the empty file to fool 'whatever' into thinking the file is actually an mp3 or jpg?) it would be greatly appreciated!

I do know how to generate empty files but they are just that, empty - changing the file extension is not good enough for my purpose.

Any help appreciated and thanks for reading!

Steven.
     
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Feb 5, 2011, 07:59 PM
 
What are you trying to do here?

Does the file need to actually be valid or just have the right header and size?
     
Mac Elite
Join Date: Jan 2000
Location: Columbus, OH
Status: Offline
Reply With Quote
Feb 8, 2011, 02:22 AM
 
Um, 250/500/1000 MB are not empty files.
HyperNova Software, LLC
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Feb 8, 2011, 08:00 PM
 
It is possible to create an file of a particular size that contains nothing but zeros using the Unix tool "dd". This file of course would not be a file that would be readable by a program designed to handle files of that type, but it would give you a file of a particular size you can give whatever name and extension you want. Is this what you had in mind?
     
Clinically Insane
Join Date: Jun 2001
Location: planning a comeback !
Status: Offline
Reply With Quote
Feb 8, 2011, 08:05 PM
 
Originally Posted by besson3c View Post
It is possible to create an file of a particular size that contains nothing but zeros using the Unix tool "dd". This file of course would not be a file that would be readable by a program designed to handle files of that type, but it would give you a file of a particular size you can give whatever name and extension you want. Is this what you had in mind?
No. He wrote:

I do know how to generate empty files but they are just that, empty - changing the file extension is not good enough for my purpose.
-t
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:57 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2