Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

create a file a set size ?

Thread Tools
 
Search this Thread
 
Old 30 May 2003, 10:40 AM
  #1  
Denzil_Dog
Scooby Regular
Thread Starter
 
Denzil_Dog's Avatar
 
Join Date: Jun 2002
Posts: 275
Likes: 0
Received 0 Likes on 0 Posts
Post

anybody know how to quickly create a file a set filesize ?
Old 30 May 2003, 10:49 AM
  #2  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

Just create as normal and fill it up with something, easiest way is with some language. 5kB file:

perl -e 'print 0 x (5 * 1024)' > file
Old 30 May 2003, 01:49 PM
  #3  
Denzil_Dog
Scooby Regular
Thread Starter
 
Denzil_Dog's Avatar
 
Join Date: Jun 2002
Posts: 275
Likes: 0
Received 0 Likes on 0 Posts
Thumbs up

cheers steve worked a treat, created the file on a sun box

i needed a std 2MB file for download testing

thanks again dude
Old 30 May 2003, 02:55 PM
  #4  
bashful
Scooby Regular
 
bashful's Avatar
 
Join Date: Aug 2002
Posts: 154
Likes: 0
Received 0 Likes on 0 Posts
Post

Beware that some WANs have some built-in compression - a file of zeros would squish up lovely and give you a false impression of the speed. On a unix box you could try dd if=/dev/random (etc. etc.)
Old 30 May 2003, 03:21 PM
  #5  
orbv
Scooby Regular
 
orbv's Avatar
 
Join Date: Apr 2001
Location: Hants
Posts: 1,103
Likes: 0
Received 0 Likes on 0 Posts
Post

mkfile 2m <filename>
dd if=/dev/zero of=<filename> bs=10k count=200

both will create different file sizes
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JimBowen
ICE
5
02 July 2023 01:54 PM
SilverM3
ScoobyNet General
8
24 February 2021 01:03 PM
Brumguy34
Subaru Parts
8
04 October 2015 07:51 PM
Nick_Cat
Computer & Technology Related
2
26 September 2015 08:00 AM
Littleted
Computer & Technology Related
0
25 September 2015 08:44 AM



Quick Reply: create a file a set size ?



All times are GMT +1. The time now is 07:34 AM.