How do I know the size of a file
Hi,
Would anybody please show me how to get the size of a file. for example, I create a file like this
FileInputStream FINPUT = new FileInputStream ("c:\\testing.prn");
I need to know the size of FINPUT before using it but I don't know how.
note: It is not neccessary to use FileInputStream. I can use any stream or file that allow me to check the size and read out the data from the file byte by byte.
Thanks a lot.
Hung
Thank you for your responding. But, how can I read out the data? I need to read the data from the file byte by byte.
Thanks
Hung.
Similar Messages
-
How can i know the size of client
hi
how can i know the size of client ?
SAP ECC6
OS AIX 5.2
DB ORACLE10g
regards
KaranHi,
1)Test run normal client copy .
=DDt will give the size.
2)There is SAP note for Client size analyse.
Here is 118823
3)run program YSTABSIZ.
Regards,
Muralidhar -
How can I know the size of DB Table
Hi, Guys,
1. How can I know the size of the DB Table in terms of kb
2. If I delete some records from the Table, does the actual size of the Table remains same or will it be reduced.
3. If size remains same after deletion, how to reduce the size ( i.e. occupied space).
thanks
MaheshHi
1. How can I know the size of the DB Table in terms of kb
There is no precise method/tcode/program to know the Table size of a tables.
Just based on the record size of a table(say for example 2kb), and if 200 records are there then, we roughly assume that it occupied 400 kb.
All the tables are stored in Table spaces.
2. If I delete some records from the Table, does the actual size of the Table remains same or will it be reduced.
Time being it remains same. it won't get reduced immediately
during some next DB reorganisation it gets reorganised by reducing it.
3. If size remains same after deletion, how to reduce the size ( i.e. occupied space).
during next DB reorganisation it gets reorganised by reducing it.
Reward points if useful
Regards
Anji -
How to know the size of a file in a program ?
I am compiling a program and I have to use a function in Java to know the size of some files. How can I do? Thanks
File.length() not good enough?
-
How can i change the size of PDF files ?
how can i change the size of PDF files? when i convert documents in the acrobat browser it seems the files become larger then normal pdf files, this is, i compare with other files that people send to me and i realise that they are smaller than my converted files, even if they have more pages.
A lot depends on the form of the PDF. Is it graphics, a scan of a text file, pure text, or other? What version of Acrobat are you working with.
You can do a save as to get a WORD file, but do not expect great results. The ability to get a decent WORD file depends on what the form of PDF you are working from. If it was created from WORD with tags and all, you might get good results. If not, you might get a lot of messed up results.
Explain what you are starting with and your ultimate goal. Also check the audit of the file (should be under PDF Optimize) to see where the file information is concentrated (text, fonts, graphics, other). -
How can I know the size of a JViewport laid out in BorderLayout.CENTER?
I have a JPanel inside a JScrollPane. The scroll pane is laid out inside of BorderLayout.CENTER. I need to know the size of the JViewport to do stuff like centering and zooming.
Where can I find the size? All these methods return 0 values for X and Y:
myScrollPane.getViewport().getSize()
myScrollPane().getSize()
myScrollPane.getHorizontalScrollbar().getValue()
Yes, even the scrollbars won't give me any values! It's all because of the BorderLayout!
Any ideas? Thanks.Sounds like you are accessing the sizes before the views are realized (that is before a call to frame.pack()/show()) They are available only after the layoutManager had a go on it. What is available earlier are preferred/min/max, though.
Greetings
Jeanette -
How can we know the size of the partition
HI,
can any one give me a query or procedure to know the size of a partition in a table in bytes
Thanks in advanceuser8884944 wrote:
HI,
can any one give me a query or procedure to know the size of a partition in a table in bytes
Thanks in advanceQuery dba_segments
select bytes, segment_name, partition_name from dba_segments
where segment_name = 'Table_name' and partition_name = 'Name of partition'
and owner = 'Owner'Regards
Anurag -
How do we know the size from the our objects in transport request no?
Dear All,
I have the need to know the size from the objects that we're gonna transport where those objects are attached in transport request no.
Is that the way to know it ?
If yes, could you kindly let me know regarding it ?
Thanks a lot,
Best regards,
Daniel N.Hi Niel,
If you want size and information of co files and data files, then the manual procedure is like this.
1. Using transaction code AL11 (to see files on server)
2. Goto folder DIR_TRFILES ( or /usr/sap/trans)
3. Double click on that row.
4. Inside that you will find two folders (among other folders)
cofiles, data
5. Goinside the subfolder you are interested. Eg. cofile
6. Now suppose you request number is ABCK900168
where ABC will be your system number, then the file name will be
K900168.ABC
or you can search for K900168
7. The data file will have the name (in data folder)
R900168
There you can see the size (length column name) of the file.
Hope this helps.
regards,
amit m. -
How can I get the size of a file with apple script
I try to get the size of a file within an apple script. But I did not find information how to do this.
There are two ways. I think Apple is moving toward using System Events, which is listed first.tell application "Finder"
set myFile to selection as alias
--this just gets a file for me to work with
--coercing it into an alias is required for the other functions
end tell
tell application "System Events"
get size of myFile
end tell
set myInfo to (info for myFile)
get size of myInfo -
How to find out the size of a file?
Hi,
I would like to determine the size of a file from my code. How is that possible? I do not find any appropriate method in the java.io.File class.
Any help would be very appreciated!java.io.File.length()
Returns the size of the file as a long. The number corresponds to the number of bytes in the file. -
How do i check the size of a file?
I want to be able to determine the size of a file in a directory. If the file has size 0kb (ie. no content), i need to be alerted to this. Is there an easy way to do this without having to read the contents of the file itself?
thanks.File.length();
-
How can i know the size of ResultSet???
i run a statment
ResultSet rs = cs.executeQuery();
rs.next();
rs.getString(i) ; <-------------------- how can i know what is the max i can i get???????
i didn't find function that returns the size of it !!!!!!!!!!
any one can help meu want to know the number of rows returned or size of columns?
-
How can we know the size of the dimension(in Line item Dim)?
Hi to all experts,
We use Line item dimension if the size of dimension is 20% or more of the fact table. My doubt is that how can v know that the size of the dimesion is 20% or more of FT?. But we never store MD in dimension tables......So please help me to understand this scenario? Thanks in advance.Hi
Normally before modelling you will assume the number of entries in your master data and transactional data..
If your dimension is having 3 characteristics
say A,B .....and these characteristic values are say
A---10,000( Total number of master data records)
B----7,000( Total number of master data records)
then your dimenstion would be 10,000 * 7,000 =700000000
in this case you better keep A in a dimension and B in another dimension.
Normally SAP recommends your dimension table shouldnot exceed 100,000...
so whenever you expect a characteristic is having more values then you should make it as line item...
If you want to add a new characteristic to the existing model then you can decide by comparing the ratio of dimension table to the fact table..
Please have a look at the below url for sizes
dimension size
Hope it helps
Thanks,
Teja
Edited by: Teja badugu on Apr 24, 2008 12:19 PM -
How do I get the size of a file on a server with an Applet
Hei,
I have a problem. I have some files that I need to read in with InputStream to get an Array of bytes. The Applet and the files are on the same server.
My Prob is, that when I use
URL(daFile).getFile().getSize();
it only gives the inaccurate size from the dirlisting (i.e. 48 for 48k)
So I can not build an array with the correct Size.
Does anyone knows how I get the correct size of a file.
Big thx
LoCalAppler can open connections to server it was downloaded from. You don't need such complicated API as RMI... Just simple java server listening for queries.
Like this:
Applet:
1. take a file path
2. connect to simple server (gives OutputStream and InputStream)
3. create ObjectOutputStream and send fiel to server (File is serializable)
4. Read String with size from input stream
Server
1. Wait for connection
2. When client connected create ObjectInputStream and expect File instance
3. Get file size
4 Replay with String with size
Like this... -
How can I limit the size of a file generated by 3rd party code?
I have a program that loads plugins from a directory and executes code in those plugins. These plugins are classes that implement a standard interface within my API. I want to be able to monitor for files generated by these plugins. Usually there are no more than 2 plugins running at once, so I could end up with 2 plugins writing files. An example would be a plugin creating an SQLite database on the filesystem.
I could monitor the current directory and guess who's file it is, but what if the files get written elsewhere? Can I do something in Java that limits what directories the Java process can write to?
I wouldn't mind being able to track their memory and CPU usage, but I don't think I can do much about that.Thank you. I just needed to be pointed in the right direction. After looking over this stuff, including FilePermission, I think this may give me what I was looking for. It will be a while before I get to implementing it or testing something like this, I'm just trying to get a grasp on all of the things I need to do and how to approach it.
By doing this I can control how much filespace it can use.
I can control CPU usage by monitoring for extra threads that don't belong and killing or settings the priority on it.
Now I just need to think of something to monitor how much memory the plugin uses. I suppose I could gc, then store the current memory usage, then execute the plugin, gc again, and measure the size again. Does that sound like a reasonable way to estimate it's memory usage? I'm not looking for tiny changes, I just want to see large, substantial increases.
Maybe you are looking for
-
MSI 785GM-E51 - Amount of usable RAM in Windows 7 Ultimate 64bit
Hello i have the following system: Mobo: MSI 785GM-E51 Bios: AMI v 2.3 CPU: AMD Phenom II 955 BE @ 3.2Ghz Memory: 2 dimms of ( KINGSTON KVR1333D3N9/2G DDR3 2GB PC10666 1333MHZ VALUE RAM ) , Total 4Gb GPU: Sapphire Radeon X1950 Pro with 256mb RAM OS:
-
Applications(iViews) in VC 7.0 to VC 7.1 CE
Hello Experts, I have a working application(iViews) in VC 7.0. I want to know how all the applications in VC 7.0 can be hosted or transfered to VC 7.1 CE Environment. Or it needs to be imported into VC 7.1 CE Environment. Please help me. Regards, Pal
-
hi, i really hope someone can help me out here... after i have done with recording video clips and i replay the video,the phone speaker came out a very noisy sound (is like a bad Radio Frequencies noise) why or how is this happen ??? how can i stop t
-
One day back I have brought HP 15-r249 tu laptop but I couldn't get any drivers for this..I searched the support in which the driver download but it shows that drivers are not available..pls help me..
-
Can i group pages in the nav bar?
I'm wondering if im able to group diferent pages in the navigation bar.