473,750 Members | 2,225 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modifying read only files with java

Hi

Can anyone provide an example of how to modify read-only files in java?

Thanks
M
Jul 17 '05 #1
5 3505
"Manavendra Gupta" <ma*********@cr amer.com> wrote in message news:<40******* *************** *@reading.news. pipex.net>...
Hi

Can anyone provide an example of how to modify read-only files in java?

Thanks
M

Change it to be writable. You can use OS command from Java if you have
the user privilege to do it.
Jul 17 '05 #2
Manavendra Gupta wrote:
Can anyone provide an example of how to modify read-only files in java?


Why do you want to do this? So you can write a trojan?

Stewart.

--
My e-mail is valid but not my primary mailbox, aside from its being the
unfortunate victim of intensive mail-bombing at the moment. Please keep
replies on the 'group where everyone may benefit.
Jul 17 '05 #3
nos
can you tell me what "read only" means

"Stewart Gordon" <sm*******@yaho o.com> wrote in message
news:c2******** **@sun-cc204.lut.ac.uk ...
Manavendra Gupta wrote:
Can anyone provide an example of how to modify read-only files in java?


Why do you want to do this? So you can write a trojan?

Stewart.

--
My e-mail is valid but not my primary mailbox, aside from its being the
unfortunate victim of intensive mail-bombing at the moment. Please keep
replies on the 'group where everyone may benefit.

Jul 17 '05 #4
nos wrote:
can you tell me what "read only" means

<snip top of upside-down reply>

Short answer:
Yes.

Long answer:
Unable to be modified.

In file systems, it tends to mean having an attribute indicating that it
cannot be modified, e.g. in order to prevent accidental changes.
However, in some cases the user can switch off this attribute.

Stewart.

--
My e-mail is valid but not my primary mailbox, aside from its being the
unfortunate victim of intensive mail-bombing at the moment. Please keep
replies on the 'group where everyone may benefit.
Jul 17 '05 #5
nos

"Stewart Gordon" <sm*******@yaho o.com> wrote in message
news:c2******** **@sun-cc204.lut.ac.uk ...
nos wrote:
can you tell me what "read only" means

<snip top of upside-down reply>

Short answer:
Yes.

Long answer:
Unable to be modified.

In file systems, it tends to mean having an attribute indicating that it
cannot be modified, e.g. in order to prevent accidental changes.
However, in some cases the user can switch off this attribute.

Stewart.

In UNIX/LINUX there is no such attribute for files or directories.
Only "read", "write", and "execute". As others have pointed out
in c.l.j.p if the directory that contains the so called "read only"
file is writable, the file can be deleted.
e.g.
drwxrwsrwx 1 Philip None 0 Mar 8 14:06 Cookies
d means directory
r means can be read
w means can be written
x means can execute
first rwx is for owner
second rwx is for members of the group
third rwx is for others
Jul 17 '05 #6

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

Similar topics

3
6398
by: Simon Wigzell | last post by:
I recently wrote a program with MS Visual Studio C++, sent it off to the client where it didn't run, after some probing I discover they are on a Mac! My program is a MSF interface that is really only 2 File buttons with corresponding text fields. The actual guts of the program is a C file that accepts 2 file names as arguments and reads from one file, manipulates the string and writes it to another file. Java and C syntax are very similar....
0
1828
by: Hal Vaughan | last post by:
While experimenting with System.getProperty() and System.setProperty(), I've noticed that I can change properties, but those changes do not last once the JVM they're modified in terminates. I experimented with java.class.path to see if I could extend it while a class was running (I think I read about this somewhere, but I can't find it again). I'm working on an install program and, if I could add directories to java.class.path during...
16
8142
by: Japcuh | last post by:
How do you write self modifying code in Java? Japcuh (Just Another Perl C Unix Hacker) http://www.catb.org/~esr/faq/hacker-howto.htm#what_is ..0. ...0 000
5
6336
by: Doug | last post by:
I would appreciate a response on this. I have clients who will be placing text files information about in a network directory for example: http://www.protegen.com/clients/ Is it possible to read these text files using either vbscript or javascript. What I am attempting to do is to read these files and then create charts for viewing by each client. A direct email to me at douglas.taylor@protegen.com will help.
2
6644
by: asenthil | last post by:
i'm trying to read and write files using java... some errors occurs when i'm trying this code.. Error in java: Cannot find symbol location: class java.io.FileOutputStream FileOutputStream fout = new FileOutputStream(outputFile); ^ import java.io.*;
1
3772
by: bogdan.taru | last post by:
Hello, I have had a lot of problems installing a DB2 v8.1 Personal Edition on a RHEL4. Solved most of them by using a JDK-1.4.1 instead of the default 1.3.1, which comes with DB2. But I still have two problems, and I think they have something in common: 1) an instance was created during the installation. I am trying to add a new instance by using: "/opt/IBM/db2/V8.1/instance/db2icrt -d -a server -s ese -u db2fenc1 db2inst2", and this...
5
2639
by: IUnknown | last post by:
Ok, we are all aware of the situation where modifying the folder structure (adding files, folders, deleting files, etc) will result in ASP.NET triggering a recompilation/restart of the application. In a nutshell, I understand how this can be considered desireable by some, but I am not one of those people. My situation is that we have a root site (hosted @ http://www.mydomain.com) in the root application folder '/'.
1
3823
by: ajmerasunny | last post by:
Hi All, I have a java web application in which I need to read a configuration file(WebAgent.conf) that has the reference of another configuration file(SmHost.conf). I am placing both these configuration files in the <root-dir> of the application. I am specifying the path for WebAgent.conf as “/WebAgent.conf” in my AuthenticateUser java class and in WebAgent.conf, the reference to SmHost.conf is given as “/SmHost.conf”. I am copying...
0
2748
by: svpriyan | last post by:
Hai Implemented a code that will read the 100s of files from a directory. Each time when i read a file , i will take that file and check the content of the file( i put them in to a List )and compare with the original List and if there is a different, then i update the array List with write function. this is what i need but i get error when i run the code, i coul dread only one file, later it stopped. it does not read the second file in...
0
9000
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9396
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9339
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4713
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.