The Artima Developer Community
Sponsored Link

Java Answers Forum
Java IO : Opened Files

2 replies on 1 page. Most recent reply: Mar 5, 2004 9:19 AM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Sanjay Ambardar

Posts: 2
Nickname: sandy1
Registered: Mar, 2004

Java IO : Opened Files Posted: Mar 3, 2004 4:21 AM
Reply to this message Reply
Advertisement
I have to create a number of files from my java program and make sure that nobody can delete them from disk. So I don't close my File Stream and keep it open till my program exits. The problem I am facing is that I am getting exception after creating 2035 files. Is this an Operating System limitation because when i keep closing the file streams then i don't face this problem? My requiremnet is that I may keep thousands of files open for sometime. Could you please help?


Viswanatha Basavalingappa

Posts: 84
Nickname: viswagb
Registered: Nov, 2003

Re: Java IO : Opened Files Posted: Mar 3, 2004 7:23 AM
Reply to this message Reply
Hi,

It is my understanding,

File open means, there is a refrence in the memory, that stack memory..here is how it works.

when you call a function open() it put the Push() the ref in the memory untill it closes it will not pop() it ,
so when you a more number the Stack memory will be not suffeciant. increas your stack memory from Heap memory..

Viswa
---------

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Java IO : Opened Files Posted: Mar 5, 2004 9:19 AM
Reply to this message Reply
Use the setReadOnly() on each of your files and then close them.

Flat View: This topic has 2 replies on 1 page
Topic: Open .doc in java Previous Topic   Next Topic Topic: Can I compile source codesusing a JAVA CODE

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use