Write file to directory
Hi,
all the while i am able to write file to different apps directories...
just recently i asked Basis to create one more directory for which i am not able to write file...
I tried to put the same file in older directory, which i am able to do.
i tried CG3Z to keep the file but in vain and finally i tried command promt to put the file there the message is no authorizations...
Mainly my question is:
Is it possible to restrict USER ID for particular directory?
Where can i check the authorizations...
Hi,
As per my understanding i should have
S_DATASET
S_RZL_ADM
Can anyone suggest me!
Similar Messages
-
Permission to create file in directory
Hi all,
I want to check permission in directory. ie. if user have permission to create a file in directory.
how can i check this.
for testing i wrote this program and i disabled all permissions for user (like read, write ) from security tab of directory properties.
so i was not able to open the directory
but it seems that canRead and canWrite are not working
public class Check {
* @param args
public static void main(String[] args) {
File s = new File("c:/testing/thisdir");
if (s.exists() && s.isDirectory()) {
System.out.println("exists");
if(s.canRead()&& s.canWrite()){
System.out.println("read n write possible");
}else{
System.out.println("read n write impossible");
} else {
System.out.println("does not exists");
Output :
exists
read n write possibleAny comments why its so...hi dcminter ,
just now changed the code ... and rechecked the permissions also ... and found that program is unable to write file inside directory...it throws following exception "java.io.IOException: Access is denied"
but still
canRead and canWrite method returns true ... i dont know why it is so
public class Check {
* @param args
public static void main(String[] args) {
try {
File s = new File("c:/testing/thisdir");
if (s.exists() && s.isDirectory()) {
System.out.println("exists");
if (s.canRead() && s.canWrite()) {
System.out.println("read n write possible");
} else {
System.out.println("read n write impossible");
File ss = new File("c:/testing/thisdir/a.txt");
ss.createNewFile();
} else {
System.out.println("does not exists");
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} -
Ok, I'm stuck. I'm trying to compile libarchive-1.3.1 ona a system and I get this error. I've tried this and that, but no luck ... anything obvious I need to install? Think there may be a broken symlink somewhere perhaps?
h-3.2# make
make all-am
make[1]: Entering directory `/media/cf/depends/libarchive-1.3.1'
if gcc -DHAVE_CONFIG_H -I. -I. -I. -I./libarchive -g -O2 -MT tar/bsdtar-write.o -MD -MP -MF "tar/.deps/bsdtar-write.Tpo" -c -o tar/bsdtar-write.o `test -f 'tar/write.c' || echo './'`tar/write.c; \
then mv -f "tar/.deps/bsdtar-write.Tpo" "tar/.deps/bsdtar-write.Po"; else rm -f "tar/.deps/bsdtar-write.Tpo"; exit 1; fi
tar/write.c:49:28: error: ext2fs/ext2_fs.h: No such file or directory
tar/write.c: In function 'write_hierarchy':
tar/write.c:599: error: 'EXT2_IOC_GETFLAGS' undeclared (first use in this function)
tar/write.c:599: error: (Each undeclared identifier is reported only once
tar/write.c:599: error: for each function it appears in.)
tar/write.c:601: error: 'EXT2_NODUMP_FL' undeclared (first use in this function)
tar/write.c: In function 'write_entry':
tar/write.c:742: error: 'EXT2_IOC_GETFLAGS' undeclared (first use in this function)
make[1]: *** [tar/bsdtar-write.o] Error 1
make[1]: Leaving directory `/media/cf/depends/libarchive-1.3.1'
make: *** [all] Error 2I've looked into Oracle Database 10g Express Edition (Universal), a .deb file, found no occi.h but did find lots of .so files (linux shared libraries). I'll try and adapt my code and Netbeans/g++ to that and see if it works...
I can't really install it since my 4GB computer is x64 and my i386 "only" has 186RAM... Enterprise Linux Release 5 Media Pack for x86 64 (64 bit) is 5.1GB+updates (~5GB each)... Not gonna waste my time installing that just for a project.
I sense i'm missing something obvious... although there's nothing obvious about *.oracle.com... information company they say? ;) -
Create directory and write files to it
i have installed tomcat 3.2.3 and am using ms access as databse.
through my jsp code i need to create random directories on the server and write files to it(need to have write access on the directories).
how do i do it?? thanx in advance.You can include java.io in ur jsp page only using
<%@ page language="java" import="java.io.File %>
then u can create directories on the fly on the server using
mkdir(s) method of the FILE Object.
You will have to specify the path while creating a File object.
You will get the application's path using
application.getRealPath() method .... to wich u can append
whatever u will like...
Once u got the directory u can also create files using file object
Hope this is of any help...
Feel free toa sk if i could not satisfy u... -
The first thing i'm doing is to get from my ftp server all the ftp content information and i tag it so i can identify later if it's a file or a directory:
private int total_dirs;
private int searched_until_now_dirs;
private int max_percentage;
private TreeNode directories_real_time;
private string SummaryText;
private TreeNode CreateDirectoryNode(string path, string name , int recursive_levl )
var directoryNode = new TreeNode(name);
var directoryListing = GetDirectoryListing(path);
var directories = directoryListing.Where(d => d.IsDirectory);
var files = directoryListing.Where(d => !d.IsDirectory);
total_dirs += directories.Count<FTPListDetail>();
searched_until_now_dirs++;
int percentage = 0;
foreach (var dir in directories)
directoryNode.Nodes.Add(CreateDirectoryNode(dir.FullPath, dir.Name, recursive_levl+1));
if (recursive_levl == 1)
TreeNode temp_tn = (TreeNode)directoryNode.Clone();
this.BeginInvoke(new MethodInvoker( delegate
UpdateList(temp_tn);
percentage = (searched_until_now_dirs * 100) / total_dirs;
if (percentage > max_percentage)
SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
max_percentage = percentage;
backgroundWorker1.ReportProgress(percentage, SummaryText);
percentage = (searched_until_now_dirs * 100) / total_dirs;
if (percentage > max_percentage)
SummaryText = String.Format("Searched dirs {0} / Total dirs {1}", searched_until_now_dirs, total_dirs);
max_percentage = percentage;
backgroundWorker1.ReportProgress(percentage, SummaryText);
foreach (var file in files)
TreeNode file_tree_node = new TreeNode(file.Name);
file_tree_node.Tag = "file";
directoryNode.Nodes.Add(file_tree_node);
numberOfFiles.Add(file.FullPath);
return directoryNode;
The line i'm using to Tag is:
file_tree_node.Tag = "file";
So i know what is "file" then i make a simple check if the Tag is not null then i know it's a "file" if it's null then it's directory.
For example this is how i'm checking if it's file or directory after getting all the content from my ftp server:
if (treeViewMS1.SelectedNode.Tag != null)
string s = (string)treeViewMS1.SelectedNode.Tag;
if (s == "file")
file = false;
DeleteFile(treeViewMS1.SelectedNode.FullPath, file);
else
RemoveDirectoriesRecursive(treeViewMS1.SelectedNode, treeViewMS1.SelectedNode.FullPath);
I also update in real time when getting the content of the ftp server xml file on my hard disk with the treeView structure information so when i'm running the program each time it will load the treeView structure with all directories and files.
This is the class of the xml file:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Windows.Forms;
namespace FTP_ProgressBar
class TreeViewXmlPopulation
// Xml tag for node, e.g. 'node' in case of <node></node>
private const string XmlNodeTag = "node";
// Xml attributes for node e.g. <node text="Asia" tag=""
// imageindex="1"></node>
private const string XmlNodeTextAtt = "text";
private const string XmlNodeTagAtt = "tag";
private const string XmlNodeImageIndexAtt = "imageindex";
public static void DeserializeTreeView(TreeView treeView, string fileName)
XmlTextReader reader = null;
try
// disabling re-drawing of treeview till all nodes are added
treeView.BeginUpdate();
reader = new XmlTextReader(fileName);
TreeNode parentNode = null;
while (reader.Read())
if (reader.NodeType == XmlNodeType.Element)
if (reader.Name == XmlNodeTag)
TreeNode newNode = new TreeNode();
bool isEmptyElement = reader.IsEmptyElement;
// loading node attributes
int attributeCount = reader.AttributeCount;
if (attributeCount > 0)
for (int i = 0; i < attributeCount; i++)
reader.MoveToAttribute(i);
SetAttributeValue(newNode,
reader.Name, reader.Value);
// add new node to Parent Node or TreeView
if (parentNode != null)
parentNode.Nodes.Add(newNode);
else
treeView.Nodes.Add(newNode);
// making current node 'ParentNode' if its not empty
if (!isEmptyElement)
parentNode = newNode;
// moving up to in TreeView if end tag is encountered
else if (reader.NodeType == XmlNodeType.EndElement)
if (reader.Name == XmlNodeTag)
parentNode = parentNode.Parent;
else if (reader.NodeType == XmlNodeType.XmlDeclaration)
//Ignore Xml Declaration
else if (reader.NodeType == XmlNodeType.None)
return;
else if (reader.NodeType == XmlNodeType.Text)
parentNode.Nodes.Add(reader.Value);
finally
// enabling redrawing of treeview after all nodes are added
treeView.EndUpdate();
reader.Close();
/// <span class="code-SummaryComment"><summary>
/// Used by Deserialize method for setting properties of
/// TreeNode from xml node attributes
/// <span class="code-SummaryComment"></summary>
private static void SetAttributeValue(TreeNode node,
string propertyName, string value)
if (propertyName == XmlNodeTextAtt)
node.Text = value;
else if (propertyName == XmlNodeImageIndexAtt)
node.ImageIndex = int.Parse(value);
else if (propertyName == XmlNodeTagAtt)
node.Tag = value;
public static void SerializeTreeView(TreeView treeView, string fileName)
XmlTextWriter textWriter = new XmlTextWriter(fileName,
System.Text.Encoding.ASCII);
// writing the xml declaration tag
textWriter.WriteStartDocument();
//textWriter.WriteRaw("\r\n");
// writing the main tag that encloses all node tags
textWriter.WriteStartElement("TreeView");
// save the nodes, recursive method
SaveNodes(treeView.Nodes, textWriter);
textWriter.WriteEndElement();
textWriter.Close();
private static void SaveNodes(TreeNodeCollection nodesCollection,
XmlTextWriter textWriter)
for (int i = 0; i < nodesCollection.Count; i++)
TreeNode node = nodesCollection[i];
textWriter.WriteStartElement(XmlNodeTag);
textWriter.WriteAttributeString(XmlNodeTextAtt,
node.Text);
textWriter.WriteAttributeString(
XmlNodeImageIndexAtt, node.ImageIndex.ToString());
if (node.Tag != null)
textWriter.WriteAttributeString(XmlNodeTagAtt,
node.Tag.ToString());
// add other node properties to serialize here
if (node.Nodes.Count > 0)
SaveNodes(node.Nodes, textWriter);
textWriter.WriteEndElement();
And this is how i'm using the class this method i'm calling it inside the CreateDirectoryNode and i'm updating the treeView in real time when getting the ftp content from the server i build the treeView structure in real time.
DateTime last_update;
private void UpdateList(TreeNode tn_rt)
TimeSpan ts = DateTime.Now - last_update;
if (ts.TotalMilliseconds > 200)
last_update = DateTime.Now;
treeViewMS1.BeginUpdate();
treeViewMS1.Nodes.Clear();
treeViewMS1.Nodes.Add(tn_rt);
TreeViewXmlPopulation.SerializeTreeView(treeViewMS1, @"c:\XmlFile\Original.xml");
ExpandToLevel(treeViewMS1.Nodes, 1);
treeViewMS1.EndUpdate();
And when i'm running the program again in the constructor i'm doing:
if (File.Exists(@"c:\XmlFile\Original.xml"))
TreeViewXmlPopulation.DeserializeTreeView(treeViewMS1, @"c:\XmlFile\Original.xml");
My question is how can i update the xml file in real time like i'm doing now but also with the Tag property so next time i will run the program and will not get the content from the ftp i will know in the treeView what is file and what is directory.
The problem is that now if i will run the program the Tag property is null. I must get the ftp content from the server each time.
But i want that withoutout getting the ftp content from server to Tag each file as file in the treeView structure.
So what i need is somehow where i;m Tagging "file" or maybe when updating the treeView also to add something to the xml file so when i will run the progrma again and read back the xml file it will also Tag the files in the treeView.Hi
Chocolade1972,
Your case related to Winform Data Controls, So i will move your thread to Windows Forms> Windows
Forms Data Controls and Databinding forum for better support.
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Brand new Mac Book Pro
Purchased in Mexico's Department store Liverpool on June 20th 2012
Purchased Memory upgade to 8Gb, on june 27th, at Apple Store Memorial City, Houston
Upgraded memory from 4Gb to 8Gb on June 28th.
Tried to write on my external HD (previously written on a windows based PC) with no success.
Upon reccomendation from a Mac assistant, copied all my external HD contents into my Mac Hard drive.
Then formatted my external HD and copied back all my information to it.
deleted all the information from my MacBook Pro HD.
Attempted to repeat the same operation with another external HD, but got a message saying there was not enough epace on the computer HD (even though I have a 750Gb Hard Drive.
Looked in the trash bin and there it was, all the information previously deleted..
Could not empty the trash bin, although I got a message asking me to safely delete all the information from the trash bin,
Could not get enough space released, after several attpempts the trash bin was finally emptied.
All happy getting acquainted with my new MacBook Pro. Two days later, got a gray screen and not able to start the computer.
Looking in to Mac support I found article http://support.apple.com/kb/TS2570 and followed instructions to perform a safe boot:
"Perform a Safe Boot
Simply performing the Safe Boot may resolve this issue.
Shut down your Mac. If necessary, hold your Mac's power button for several seconds to force it to power down.
Start your Mac, then immediately hold the Shift key. This performs a Safe Boot. Advanced tip: If you want to
see the status of a Safe Boot as it progresses, you can hold Shift-Command-V during start up (instead of just Shift).
Note: A Safe Boot takes longer than a typical start up because it includes a disk check and other operations.
The following is the script that appears on the screen upon safe boot. and halt after the last line.
AppleACPICPU:Processor Id=6 LocalAplicId=255 Disabled
AppleACPICPU:Processor Id=7 LocalAplicId=255 Disabled
AppleACPICPU:Processor Id=8 LocalAplicId=255 Disabled
calling mpo_policy_init for TMSafetyNet
Security policy loaded: Safety net for Time Machine (TMSafetyNet)
calling mpo_policy_init for Sandbox
Security policy loaded: Seatbelt sandbox policy (Sandbox)
calling mpo_policy_init for Quarantine
Security policy loaded: Quarantine Policy (Quarantine)
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All Rights Reserved.
MAC Framework Succesfully initializad
using 16384 buffer headers and 10240 cluster IO buffer headers
IOAPIC: Version 0x20 Vextors 64:87
ACPI: System State [SO S3 S4 S5] (S3)
PFM64 (36cpu) 0xf10000000, 0xf0000000
Aplconsole relocated to 0xf1000000
PCI configuration changed (bridge=16 device=4 cardbus=0)
[ PCI configuration end, bridges 12 devices 16 ]
Firewire (OHCI) Lucent ID 5901 built-in now active, GUID 3c0754fffe9b2aa2; max speed s800.
Pthread support ABORTS when sync kernel primitives misused
com.apple.AppleFSCompressionTypeZlib kmod start
com.apple.AppleFSCompressionTypeDataless kmod start
com.apple.AppleFSCompressionTypeZlib load succeeded
com.apple.AppleFSCompressionTypeDateless load succeeded
AppleIntelCPUPowerManagementClient: ready
BTCOEXIST off
wl0: Broadcom BCM4331 802.11 Wireless controller
5.100.98.75
AppleUSBMultitouchDriver::checkStatus - received Status Packet, Payload 2: device was reinitializad
rooting via boot-uuid from /chosen: 6E918706-FC0D-37460-A3A0-6268A51DF93B
Waiting on <dict ID="0"><key><string ID="1">IOResources</string><key>IOResourceMatch</key><string ID="2">boot-uuid-media</string></dict>
Got boot device = IOService:/AppleACPIPlatformExpert/PCI0@0/AppleAPIPCI/SATA@1F,2/AppleIntelPchSe riesAHCI/PRT0@0/AOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlock
storageevice /IoBlockStorageDriver/TOSHIBA MK7559GSXF Media/IOGUIDPartit
BSD root: disk0s2, major 14, minor 2
Kernel is LP64
com.apple.launchd 1 com.apple.launchd 1 *** launchd[1] has started up. ***
com.apple.launchd 1 com.apple.launchd 1 *** Verbose boot, will log to /dev/console. ***
Running fsck on the boot volume...
** /dev/rdisk0s2 (NO WRITE)
** Root file system
Executing FSCK_HFS (version diskdev_cmds-540.1~25).
BootCacheControl: UNable to open /Var/db/BootCache.playlist:2 No such file or directory
launchctl:Dubious permissions on file (skipping): /Library/LaunchDaemons
launchctl:Dubious permissions on file (skipping): /System/Library/LaunchDaemons
Any help or suggestions on what to do next would be welcomed.
I am in the middle of the Atlantick, stuck with a brand new, non working Apple MacBook Pro.
Best regards
Sergio RamosReinstalling MacOS does NOT fix the problem for me. I'm still searching a solution !
Bernard -
Searching file from directory located at http path.
Hi All,
I have made the program to search for a file in a directory and its subdirectories. This is working fine when my directory is located on local machine. But if the same directory is placed in HTTP path, the code fails to search a directory. Does anyone has idea how can i connect to site so as to access the directories. I used URL and URLConnection to read and write file to the site, and this is also working fine but when it comes to directories i find no solution. Please help.This works fine if i map http://flash/ on my C: and
try to list files in directory C:\Mojo. Can you please
tell how can i know whether the http server i am
trying to access allows directory listing or not.
Because if it does not i have administrator rights on
the server and i can make the changes required.You can see if your Web server allows directory listing by simply
typing in the URL you want to examine, inside your browser, and see if
it shows you a directory listing. For instance, if you type in:
http://flash/Mojo/
in your browser's address bar, and you see a list of files in that
directory, then your Web server supports directory listing.
Note, though, that you can't use the File list() method to get a list of files.
You'll have to make a connection, read the input stream, and then parse
the filenames out of the HTML that the Web server returns. (You can see
what the HTML looks like, by doing View Source inside your brower. That's
what you'll get back from your Java program.)
--Steve -
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. -
Getting `No such file or directory` error while trying to open bdb database
I have four multi-threaded processes (2 writer and 2 reader processes), which make use of Berkeley DB transactional data store. I have multiple environments and the associated database files and log files are located in separate directories (please refer to the DB_CONFIG below). When all these four processes start to perform open and close of databases in the environments very quickly, one of the reader process is throwing a No such file or directory error even though the file actually exists.
I am making use of Berkeley DB 4.7.25 for testing out these applications.
The four application names are as follows:
Writer 1
Writer 2
Reader 1
Reader 2
The application description is as follows:
‘*Writer 1*’ owns 8 environments and each environment having 123 Berkeley databases created using HASH access method. At any point of time, ‘*Writer 1*’ will be acting on 24 database files across 8 environments (3 database files per environment) for carrying out write operation. Where as reader process will be accessing all 123 database files / per environment (Total = 123 * 8 environments = 984 database files) for read activities. Similar configuration for Writer 2 as well – 8 separate environments and so on.
Writer 1, Reader 1 and Reader 2 processes share the environments created by Writer 1
Writer 2 and Reader 2 processes share the environments created by Writer 2
My DB_CONFIG file is configured as follows
set_cachesize 0 104857600 1 # 100 MB
set_lg_bsize 2097152 # 2 MB
set_data_dir ../../vol1/data/
set_lg_dir ../../vol31/logs/SUBID/
set_lk_max_locks 1500
set_lk_max_lockers 1500
set_lk_max_objects 1500
set_flags db_auto_commit
set_tx_max 200
mutex_set_increment 7500
Has anyone come across this problem before or is it something to do with the configuration?Hi Michael,
I should have included about how we are making use of DB_TRUNCATE flag in my previous reply itself. Sorry for that.
From writers, DB truncation happens periodically. During truncate (DB handle is not associated with any environment handle i.e. stand-alone DB
) following parameters are passed to db->open function call:
DB->open(DB *db,
DB_TXN *txnid, => NULL
const char *file, => file name (absolute DB file path)
const char *database, => NULL
DBTYPE type, => DB_HASH
u_int32_t flags, => DB_READ_UNCOMMITTED | DB_TRUNCATE | DB_CREATE | DB_THREAD
int mode); => 0
Also, DB_DUP flag is set.
As you have rightly pointed out, `No such file or directory` is occuring during truncation.
While a database is being truncated it will not be found by others trying to open it. We simulated this by stopping the writer process (responsible for truncation) and by opening & closing the databases repeatedly via readers. The reader process did not crash. When readers and writers were run simultaneously, we got `No such file or directory` error.Is there any solution to tackle this problem (because in our case writers and readers are run independently. So readers won't come to know about truncation from writers)?
Also, we are facing one more issue related to DB_TRUNCATE. Consider the following scenario:
<ul><li>Reader process holds reference of database (X) handle in environment 'Y' at time t1
</li>
<li>Writer process opens the database (X) in DB_TRUNCATE mode at time t2 (where t2 > t1)</li>
<li>After truncation, writer process closes the database and joins the environment 'Y'</li>
<li>After this any writes to database X is not visible to the reader process</li>
<li>Once reader process closes the database X and re-joins the environment, all the records inserted from writer process are visible</li>
</ul>
Is it the right behavior? If yes, how to make any writes visible to a reader process without closing and re-opening the database in the above-mentioned scenario?
Also, when [db_set_errfile|http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/db_set_errfile.html] was set, we did not get any additional information in the error file.
Thanks,
Magesh -
Dear Experts,
Please note that I am facing a chllenge while confiuguring the VNCServer on the local test Server. The Local Test Sver OS Version is Redhat Enterprise Linux Server
Release 5.5 32-bit. Please review the following error message and advise me on how to fix the vncserver issue.
[root@test .vnc]# cat xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
gnome-session &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
[root@test .vnc]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="1:oracle"
[root@test .vnc]# ls
passwd test.oracle.co.zm:1.pid test.oracle.co.zm:3.log test.oracle.co.zm:5.pid test.oracle.co.zm:6.pid
test.oracle.co.zm:1.log test.oracle.co.zm:2.log test.oracle.co.zm:5.log test.oracle.co.zm:6.log xstartup
[root@test .vnc]# more test.oracle.co.zm:1.log
Xvnc Free Edition 4.1.2
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 70101000, The X.Org Foundation
Tue Mar 11 11:18:37 2014
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5901
vncext: Listening for HTTP connections on port 5801
vncext: created VNC server for screen 0
Could not init font path element unix/:7100, removing from list!
localuser:root being added to access control list
No profile for user 'root' found
SESSION_MANAGER=local/test.oracle.co.zm:/tmp/.ICE-unix/13603
Window manager warning: Log level 32: could not find XKB extension.
** (eggcups:13671): WARNING **: IPP request failed with status 1030
** (eggcups:13671): WARNING **: IPP request failed with status 1030
** (nm-applet:13697): WARNING **: No connections defined
Initializing nautilus-open-terminal extension
Unable to open desktop file /usr/share/applications/redhat-email.desktop for panel launcher: No such file or directory
Unable to open desktop file /usr/share/applications/openoffice.org-1.9-writer.desktop for panel launcher: No such file or directory
Unable to open desktop file /usr/share/applications/openoffice.org-1.9-impress.desktop for panel launcher: No such file or directory
Unable to open desktop file /usr/share/applications/openoffice.org-1.9-calc.desktop for panel launcher: No such file or directory
[root@test .vnc]#
Regards
Mohammed Abdul MuqeetHi,
Try these 3 solutions
1. Did you start vncserver services as:
service vncserver start
2.Check that port 5901 has not been blocked by a firewall:
# nc -vz localhost 5901
You should get a connection and a termination. If you get an error, fix the firewall.
3. service iptables stop
Hope This Helps
Regards,
-DK -
Is a file (or directory) writeable?
I am using Visual Studio 2010 and am trying to find the answer to a very simple question (I thought). Given the path of a file or a directory, is the user allowed to overwrite the file or write into the directory?
I coded the following:
FileInfo fsi = new FileInfo(filename);
FileAttributes attrs = fsi.Attributes;
if ((attrs & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
XmlStore.LoadFailureMessage = filename + " is readonly, not supported";
return false;
but it did not work when I specified a File in the drive C root directory for an unprivileged user. Yet if I attempted to write into that directory I got a message that I did not have permission.
Am I doing something stupid? Thanks in advance for any help.
Michael BateThe only reliable way to test whether a file is readable is try to open a write handle to the file. There is no other reliable way because there are so many reasons that can block you from writing to it. (File permissions, attributes, share permission,
existing opened handle that does not enable shared-write, etc.)
In your case, you've hit by something known as "only process that run as SYSTEM and TRUSTEDINSTALLER can write to directory owned by TRUSTEDINSTALLER" problem that exist on Vista+. Please try to write to
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) instead. -
Mac Book Pro, late 2011. Purchased in a department store in Mexico.
Was running ok for several days after I purchased it.
Had some software installed and memory upgraded from 4 to 8Gb.
Suddenly at start up, got a gray screen with a spinning wheel and never boot.
Followed advise from http://support.apple.com/kb/TS2570 and performed a safe boot. (hold Shift-Command-V during startup instead of just Shift).
The boot sequence starts then stops and nothing happens. these are the last lines of the boot sequence.
BSD root: disk0s2, major 14, minor 2
Kernel is LP64
com.apple.launchd 1 com.apple.launchd 1 *** launchd[1] has started up. ***
com.apple.launchd 1 com.apple.launchd 1 *** Verbose boot, will log to /dev/console. ***
Running fsck on the boot volume...
** /dev/rdisk0s2 (NO WRITE)
** Root file system
Executing FSCK_HFS (version diskdev_cmds-540.1~25).
BootCacheControl: Unable to open /Var/db/BootCache.playlist:2 No such file or directory
launchctl:Dubious permissions on file (skipping): /Library/LaunchDaemons
launchctl:Dubious permissions on file (skipping): /System/Library/LaunchDaemons
For what little experience I have on Unix systems, it has to do with the libraries which cannot be launched...
Any ideas, solutions, suggestions are welcomed.
Cheers.
DipbajaBoot into Recovery (command-R at startup), launch Disk Utility, select your startup volume, and run Repair Permissions. Then reboot as usual.
-
How to write file at server end?
Hi,
I use a af:inputFile component to receive uploaded files. And want to write files to the directory of server. However, when execute java.io.File.createNewFile(), it throw exception. How to resolve it?
import org.apache.myfaces.trinidad.model.UploadedFile;
import javax.faces.event.ValueChangeEvent;
import java.io.InputStream;
import java.io.File;
public class UploadFileHandler {
public void doUpload(ValueChangeEvent event) throws IOException {
File file = new File("C:\temp.txt");
*file.createNewFile();* //Error happen here.
}Hi Cheney,
It is good practice to use System.getProperty("file.separator") instead of hardcoding "/" or "\" .
Though your issue is resolved by using "//", you might want to consider changing to the above.
-Arun -
Disk Utility "restore" fails with "no such file or directory"
Some time back, perhaps a LONG time ago, I successfully used Disk Utility's "restore" function to "clone" my Mac OS X partition onto an external disk, before I upgraded the OS on my internal drive.
This weekend I tried to do it again, and failed on every attempt.
My first attempt was on my MacBook. At very end (the progress "bar" was all blue) it died saying that there was an error (2), "no such file or directory". I think the external drive probably isn't GUID, which would make it non-bootable, but I'd still think "restore" itself should work.
Okay, let's try my Power Mac G5, which is where it worked several releases ago. Same thing.
Okay, one more try... Booted into safe mode (in case background activity accounts for the missing file/directory), did the restore again, failed again.
I realize that SuperDuper or Carbon Copy Cloner or other tools may be "better", but since this worked once it seems like it still should.
Any ideas?
DougDid you:
A. Repair the hard drive and permissions prior to cloning?
B. Erase the destination drive before cloning?
Repairing the Hard Drive and Permissions
Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now shutdown the computer for a couple of minutes and then restart normally.
If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger) and/or TechTool Pro (4.5.2 for Tiger) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
How to Clone Using Restore Option of Disk Utility
1. Open Disk Utility from the Utilities folder.
2. Select the backup or destination volume from the left side list.
3. Click on the Erase tab in the DU main window. Set the format type to Mac OS Extended (journaled, if available) and click on the Erase button. This step can be skipped if the destination has already been freshly erased.
4. Click on the Restore tab in the DU main window.
5. Select the backup or destination volume from the left side list and drag it to the Destination entry field.
6. Select the startup or source volume from the left side list and drag it to the Source entry field.
7. Double-check you got it right, then click on the Restore button.
8. Select the destination drive on the Desktop and press COMMAND-I to open the Get Info window. At the bottom in the Ownership and Permissions section be sure the box labeled "Ignore Permissions on this Volume" is unchecked. Verify the settings for Ownership and Permissions as follows: Owner=system with read/write; Group=admin with read/write; Other with read-only. If they are not correct then reset them.
For added precaution you can boot into safe mode before doing the clone. -
F4 Help to get the path for a File source directory
There are numerous function modules for browsing a particular file in desktop and getting the file path (including the fine name) , like F4_FILENAME , KD_GET_FILENAME_ON_F4 , WS_FILENAME_GET etc. But can anyone tell me how to fetch only the directory path to the field were the F4 help is given. Actually the filename has to come in some other field in the selection screen. Is there separate funtion modules for these OR will changing parameters in the above function modules work?
Pls Help....
Also are there function modules for providing F4 help for getting the path to a file in application directory?Try this method CL_GUI_FRONTEND_SERVICES.
It is a Global CLASS which is having different methods for different purposes
see the documentation of it and use the methods of it
see
CL CL_GUI_FRONTEND_SERVICES
Short Text
Frontend Services
Functionality
The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
File functions
Directory functions
Registry
Environment
Write to / read from clipboard
Upload / download files
Execute programs / open documents
Query functions, such as Windows directory, Windows version, and so on
Standard dialogs (open, save, directory selection)
Example
Determine the temp directory on your PC:
DATA: TEMP_DIR TYPE STRING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GET_TEMP_DIRECTORY
CHANGING
TEMP_DIR = TEMP_DIR
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2.
IF SY-SUBRC 0.
Error handling
ENDIF.
flush to send previous call to frontend
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
IF SY-SUBRC 0.
Error handling
ENDIF.
WRITE: / 'Temporary directory is:', TEMP_DIR.
Notes
The class CL_GUI_FRONTEND_SERVICES is based on the Control Framework. See the documentation for more information, in particular on CL_GUI_CFW=>FLUSH which must be called after many CL_GUI_FRONTEND_SERVICES methods.
Migration Information
The old file transfer model was based on function modules of the function group GRAP. The old features have been replaced by the class CL_GUI_FRONTEND_SERVICES. The following list contains the old function modules (italic) and the new methods (bold) that replace them:
CLPB_EXPORT
CLIPBOARD_EXPORT
CLPB_IMPORT
CLIPBOARD_IMPORT
DOWNLOAD
GUI_DOWNLOAD, dialog replaced by FILE_SAVE_DIALOG
PROFILE_GET
No replacement, use REGISTRY_* methods instead
PROFILE_SET
No replacement, use REGISTRY_* methods instead
REGISTRY_GET
REGISTRY_GET_VALUE, REGISTRY_GET_DWORD_VALUE
REGISTRY_SET
REGISTRY_SET_VALUE, REGISTRY_SET_DWORD_VALUE
UPLOAD
GUI_UPLOAD, dialog replaced by FILE_OPEN_DIALOG
WS_DDE
Obsolete: This function is no longer supported.
SET_DOWNLOAD_AUTHORITY
Obsolete: This function is no longer supported.
WS_DOWNLOAD
GUI_DOWNLOAD
WS_DOWNLOAD_WAN
Obsolete: This function is no longer supported.
WS_EXCEL
Obsolete: This function is no longer supported.
WS_EXECUTE
EXECUTE
WS_FILENAME_GET
FILE_SAVE_DIALOG, FILE_OPEN_DIALOG
WS_FILE_ATTRIB
FILE_SET_ATTRIBUTES, FILE_GET_ATTRIBUTES
WS_FILE_COPY
FILE_COPY
WS_FILE_DELETE
FILE_DELETE
WS_MSG
Obsolete: This function is no longer supported.
WS_QUERY
CD (current directory)
DIRECTORY_GET_CURRENT
EN (read/write environment)
ENVIRONMENT_GET_VARIABLE
ENVIRONMENT_SET_VARIABLE
FL (determine file length)
FILE_GET_SIZE
FE (check if file exists)
FILE_EXIST
DE (check if directory exists)
DIRECTORY_EXIST
WS (determine Windows system)
GET_PLATFORM
OS (operating system)
GET_PLATFORM
WS_UPLDL_PATH
Obsolete: This function is no longer supported.
WS_UPLOAD
GUI_UPLOAD
WS_VOLUME_GET
Obsolete: This function is no longer supported.
Reward points if useful.
Maybe you are looking for
-
No trumpet and trombone solo in the Orchestra pack?
I am recording my orchestra piece in Logic 8 with the Orchestra jam pack and can't find the trumpet and trombone (legato/stacc) solo instruments. Don't tell me they are not included! If not, anyone knows a way to get these instruments without buying
-
Hp envy 17 j140 laptop won't power on
power was blinking would not power up tryed removing battery now nothing no lights execpt a/c charger light
-
** XPath condition not work well in Receiver Determination.
Hi, My scenario is having 3 receivers. I have 'Student' is the data type. I use the same data type for Source & Target Message Types. Requirement is I have to send 1) only records which are having SCOURSE = 'BE' to receiver 1 2) only records which ar
-
OS 10.5.4 Strange problem installing some applications
Hi, I am running a macPro 2.66 with one boot drive on Leopard and one on Tiger. I have noticed that when using Tiger and installing a new application I just grag it into the applications folder and BINGO.. it's installed. If I take the same applicati
-
Converting Canon .CR2 files to .dng
I have what appears to be the latest version of the Adobe DNG Converter (8.6.0.254); but when I direct it to a folder containing .CR2 files from my Canon PowerShot G7X camera, it tells me "No items match your search" and does no conversion. How can I