How to delete a READ ONLY file from Directory
Hi Friends,
how to delete a READ ONLY file from Directory , file is in my system only.
Please help me .
note: its read only file.
Thank you.
Karthik.
hI,
try with this statement.
delete dataset <datasetname>.
this will definitely work.
Regards,
Nagaraj
Similar Messages
-
How to get and read a file from META-INF directory
how to get and read a file from META-INF directory in a EJB project
Use this.getClass().getResourceAsStream("/META-INF/filename");This should work. Probably, you would need to set the Manifest Class-Path attribute.
-
HOW TO READ MULTIPLE FILES FROM DIRECTORY
i have a directory with 100 .sql insert scripts.i want to read all .sql files from directory and execute the insert script automatically.
Let's suppose you have 3 files: "first.sql", "second.sql" and "third.sql". Create a file named "all.sql" in the same directory, containing this:
@@first.sql
@@second.sql
@@third.sqlRun "all.sql". -
How to open and read many files from a directory and store contents in 2D array?
I want to make a VI that opens and reads the data from various files contained in a directory (200 files each with 2 columns) and store these in a single 2D array. For file number 1 I want to store the data from both columns in the 2D array, but for files 2 to 200 I only want to store the second column of each file. Can someone please help?
Hi Nadav,
Thanks for your help. I have followed your instructions but i cannot get it to work. I used the LIST DIRECTORY to list the files in the directory - that works. However, how do I read each of the 200 files using READ FROM SPREADSHEET FILE without me having to manually select each of the 200 files? So, if I use LIST DIRECTORY to list all 200 files in an array, how do I get each of these to open and store the data in a 2D array? Here is what I have done (File called read_files.VI) Could you please help me? Thank you very much in advance.
Attachments:
read_files.vi 18 KB -
How use PHP to read image files from a folder and display them in Flex 3 tilelist.
Hello. I need help on displaying images from a folder dynamically using PHP and display it on FLEX 3 TileList. Im currently able to read the image files from the folder but i don't know how to display them in the TileList. This is my current code
PHP :
PHP Code:
<?php
//Open images directory
$imglist = '';
$dir = dir("C:\Documents and Settings\april09mpsip\My Documents\Flex Builder 3\PHPTEST\src\Assets\images");
//List files in images directory
while (($file = $dir->read()) !== false)
if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
echo "filename: " . $file . "\n";
$dir->close();
?>
FLEX 3 :
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="pic.send();">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ItemClickEvent;
import mx.rpc.events.ResultEvent;
public var image:Object;
private function resultHandler(event:ResultEvent):void
image = (event.result);
ta1.text = String(event.result);
private function faultHandler(event:FaultEvent):void
ta1.text = "Fault Response from HTTPService call:\n ";
]]>
</mx:Script>
<mx:TileList x="31" y="22" initialize="init();" dataProvider = "{image}" width="630" height="149"/>
<mx:String id="phpPicture">http://localhost/php/Picture.php</mx:String>
<mx:HTTPService id="pic" url="{phpPicture}" method="POST"
result="{resultHandler(event)}" fault="{faultHandler(event)}"/>
<mx:TextArea x="136" y="325" width="182" height="221" id="ta1" editable="false"/>
<mx:Label x="136" y="297" text="List of files in the folder" width="182" height="20" fontWeight="bold" fontSize="13"/>
</mx:Application>
Thanks. Need help as soon as possbile. URGENT.i have made some changes, in the php part too, and following is the resulting code( i tried it, and found that it works.):
PHP Code:
<?php
echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<root>
<images>
<?php
//Open images directory
$dir = dir("images");
//List files in images directory
while (($file = $dir->read()) !== false)
if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
echo "<image>" . $file . "</image>"; // i expect you to use the relative path in $dir, not C:\..........
//$dir->close();
?>
</images>
</root>
Flex Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="callPHP();">
<mx:Script>
<![CDATA[
import mx.rpc.http.HTTPService;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ItemClickEvent;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var arr:ArrayCollection = new ArrayCollection();
private function callPHP():void
var hs:HTTPService = new HTTPService();
hs.url = 'Picture.php';
hs.addEventListener( ResultEvent.RESULT, resultHandler );
hs.addEventListener( FaultEvent.FAULT, faultHandler )
hs.send();
private function resultHandler( event:ResultEvent ):void
arr = event.result.root.images.image as ArrayCollection;
private function faultHandler( event:FaultEvent ):void
Alert.show( "Fault Response from HTTPService call:\n " );
]]>
</mx:Script>
<mx:TileList id="tilelist"
dataProvider="{arr}">
<mx:itemRenderer>
<mx:Component>
<mx:Image source="images/{data}" />
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
</mx:Application> -
How to edit a read-only file?
PDF files that I used to be able to edit to are now suddenly read-only. Across the top bar, it says "The file you have opened complies with the PDF/A standard and has been opened read-only to prevent modification." How do I change that so I can make edits? Under Security Properties, it says Signing and Filling Forms is allowed. I have Adobe Reader X.
Thanks. In case others have the same question, that mode is under Documents (in Preferences)
-
How to write and read Xml file from database if possible?
Hi all,
I need to read the .Xml file when receives from Source systems and write the data into the table as well as write in the.xml file thru reading the data from table as per the client needs. I am stranger to this area. Since, please provide some examples how to approach the same.
Thanks in advance !!
Regards.
Vissu.....The XML DB forum is better suited to your question.
It also has a FAQ which details how to read and shred XML into tables as well as other common XML based questions...
XML DB FAQ -
How to delete a 6.2gb file from my ipad.
I downloaded 6.2gb of holiday video from my PC through iTunes to iMovie and synced onto my ipad. It used up the 6.2gb on my ipad (in settings) but does not appear anywhere at all. How can I find and delete the 6.2gb from my ipad?
I assume you meant that you synced the finished file via iTunes to your iPad. If you did this, did you make sure you sleeked the make iPad version from the tool bar in iTunes.
If you didn't. Then sync your iPad again, but select no movies to be synced. This should remove the 6.2gb file. Just as a thought I have a number dof digital copy movies from DVDs on my pad and none are more that 2.5 gb and that's for a 2 hr 30 min movie. How long is yours?
If it's HD then it may not play on an iPad as the display is only 1024 wide in landscape -
How to delete a write protected file from nokia x7...
There are some files that i need to delete from my nokia x7 phone memory. ( one mp3 file and a photo). It says that the file is write protected. Pls advice me
The files MAY be embedded within the Firmware .. Even NCC can't remove them ...
The cost of Battery may vary according to Region. You may contact Nokia Care or Authorised dealers in your area to know the exact price ...Anyways to get the battery replaced you need to visit Nokia Care .. -
How can I get read only files out of the trash?
Either by deleting them, or moving them out. I have to click continue about 170 times just to get through the files to empty the rest of my trash.
Unlock them first.
Open terminal.app,
enter the following command:
sudo chflags -R nouchg ~/.Trash
(press return, enter admin password, press return again)
#this will unlock them in THE CURRENT user directory Trash folder#
Kj -
How can I disable read/write restriction from directory, disk is not full ?
Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory. Please check that this directory has no read/write restrictions and your hard disk is not full or close to full. It is recommended that you exit the application and fix the problem. If you continue to use this session, you might see incorrect application behaviour when accessing security features.
See:
*https://support.mozilla.com/kb/Could+not+initialize+the+browser+security+component -
Read file from directory, update contents of the each file
hai,
I could not understand how to debug the error i have now.
target
1- read the files from directory // i able ot do this part
2- for each file
for each file read the content & compare with the existing List & update the list // i able to do this part
when i try to combine both parts , i got some following error
run:
E:\java\check\100130.ixf
Error: children[i] (The system cannot find the file specified)
BUILD SUCCESSFUL (total time: 2 seconds)
i can see from the code that children[i] only gives the error when i use that in the second part of the code.
can any one help me on this??
Thanks
Priyan
the original code
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.util.ArrayList;
public class CompareList
public static void main(String[] args){
ArrayList a1 = new ArrayList();
ArrayList a2 = new ArrayList();
a1.add("1");
a1.add("2");
a1.add("3");
a1.add("4");
a1.add("5");
a1.add("6");
a1.add("7");
a1.add("8");
a1.add("9");
a1.add("10");
a1.add("11");
a1.add("12");
a1.add("13");
a1.add("14");
a1.add("15");
a1.add("16");
a1.add("17");
a1.add("18");
a1.add("19");
a1.add("20");
a1.add("21");
a1.add("22");
a1.add("23");
a1.add("24");
a1.add("25");
a1.add("26");
a1.add("27");
a1.add("28");
a1.add("29");
a1.add("30");
a1.add("31");
a1.add("32");
a1.add("33");
a1.add("34");
a1.add("35");
a1.add("36");
a1.add("37");
a1.add("38");
a1.add("39");
a1.add("40");
a1.add("41");
a1.add("42");
a1.add("43");
a1.add("44");
a1.add("45");
a1.add("46");
a1.add("47");
a1.add("48");
a1.add("49");
a1.add("50");
a1.add("51");
a1.add("52");
try{
File dir = new File("E:\\java\\check");
File[] children = dir.listFiles();
if (children == null) {
System.out.println("does not exist or is not a directory");
else {
for (int i = 0; i < children.length; i++) {
System.out.println( children);
FileInputStream fstream = new FileInputStream("children[i]");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) {
String line =strLine.substring(0,2);
// Print the content on the console
//System.out.println(line);
a2.add(line);
} // end of add list2
if (a1.size() > a2.size())
int k = 0;
for (int l = 0; l < a2.size(); l++)
if (!((String)a1.get(l)).equals((String)a2.get(l)))
//System.out.println((String)a2.get(i));
// System.out.println("dd");
k = l;
k++;
for (int l = k; l < a1.size(); l++)
System.out.println((String)a1.get(l));
String str = "children[l]";
File file = new File(str);
RandomAccessFile rand = new RandomAccessFile(file,"rw");
rand.seek(file.length()); //Seek to end of file
rand.writeBytes((String)a1.get(i)); //Write end of file
rand.writeBytes("., 0.");
rand.writeBytes("\n");
}// end of comparing and updating the list2
in.close();
catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());thanks for the information.
i tried, the error
like this
run:
E:\java\check\100130.ixf
java.lang.StringIndexOutOfBoundsException: String index out of range: 2
at java.lang.String.substring(String.java:1935)
at CompareList.main(CompareList.java:84)
BUILD SUCCESSFUL (total time: 0 seconds)this comes because in my code i used children[i] as string in the later part
else {
for (int i = 0; i < children.length; i++) {
System.out.println( children);
FileInputStream fstream = new FileInputStream(children[i]);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) {
String line =strLine.substring(0,2);
a2.add(line);
System.out.println(line);
} // end of add list2
if (a1.size() > a2.size())
int k = 0;
for (int l = 0; l < a2.size(); l++)
if (!((String)a1.get(l)).equals((String)a2.get(l)))
//System.out.println((String)a2.get(i));
// System.out.println("dd");
k = l;
k++;
for (int l = k; l < a1.size(); l++)
System.out.println((String)a1.get(l));
String str = "children[l]";
File file = new File(str);
RandomAccessFile rand = new RandomAccessFile(file,"rw");
rand.seek(file.length()); //Seek to end of file
rand.writeBytes((String)a1.get(i)); //Write end of file
rand.writeBytes("., 0.");
rand.writeBytes("\n");
rand.close();
}// end of comparing and updating the list2
in.close();
i stil could not figure out it yet. do u have any clue with this. -
HOW TO DELETE ADOBE READER FILE FROM ADOBE READER
HOW TO DELETE ADOBE READER FILE FROM ADOBE READER@ !@
Your question make no sense. What exactly are you trying to do?
-
How can I read text files from LAN if I only know the hostname?
I'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
<p>1. How can I read text files from LAN if I only know the hostname, or IP address?
<p>2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.
(ex. how can I read the 120th line?)
<p>Please help!
<p>sorry for the bad englishI'm new in Java Developing, and dont know the written classes yet. I need help, how to do the following steps?
1. How can I read text files from LAN if I only know the hostname, or IP address?You need to know the URL of the file. You need to know the hostname, port, protocl and relative path.
The hostname is server, not file.
2. How to read lines from text files without read all lines from the beginning of file, just seek to a position.Use the seek() to get to a random byte.
(ex. how can I read the 120th line?)The only way to find the 120th line is to read the first 120 lines. You can use other file formats to find the 120th line without reading the whole file but to need to be able to detremine where the 120th line is -
How to read only files with a certain format from folder with java
I have this folder on the server and I only want to read files from this folder on the server... I only want to read files with the files format starting with error_ and ending with xml... an example of a file would be..
error_123.xml
I want something like this
if(fileName.startsWith("error_") && fileName.endsWith(".xml")){
but which java package will I have to use to read the file from the directory...Create an implementation of the java.io.FilenameFilter interface to match the pattern you need.
Create a java.io.File object for the folder.
Use the File.listFiles(FilenameFilter) method to get an array of File objects for the files in the folder that match the pattern.
For each file in the array, create a FileInputStream, wrap it in an InputStreamReader, and wrap that in a BufferedReader (assuming you want to read the XML files as character streams).
Maybe you are looking for
-
ITunes and my iPod. 80 gig video. won't detect it.
My iPod shows up on My Computer but does show up in iTunes. No error message or nothing. I filled up my iPod on my brother's computer, but on mine it will not work. Is there a way I can manually load it up instead of it auto detecting? I have latest
-
InfoView - How to Restrict values of Month Dimension Combo Box
Post Author: alexrox CA Forum: Publishing Product: Business Objects Enterprise XI R2 Version: XI R2 Patches Applied: Operating System(s): Linux RHEL 4 x86 Database(s): Oracle 10gR2 Error Messages:Steps to Reproduce: Hello, we are using Business Objec
-
SD - Two message category for an invoice document type
Good morning all, I use InterCompany biling in SD with standard invoice document type 'IV' and message category 'RD04' (which enables vendor invoice creation). My customer asks to be able to print a form for the intercompany bills. For the non inte
-
How to determine the transaction type?
Hello, I have a requirement to disable the user when the role string field on the usr form is empty. I set up a post update entity adapter to do that and it works fine. When I want to enable the user using the Enable button, the above post update ent
-
I've got several pages that have text that looks great in iWeb but when published the text is vertically "squashed together" making it hard to read. You can see an example of this at: http://web.mac.com/jwarrenod/WEC/Dr._Warren.html Is this a font su