Getting directory name
Hi All,
What I would like to do is use a directory we've created, say XMLDIR.
XMLDIR points to /home/xml/
(Have got read/write permissions on directory)
This is the portion of the PL/SQL code(below) where I would like to use it. As you
can see I'm saving an XML file. Now I need to save this XML file to the XMLDIR directory.
How do I use this directory that has been created?
xmldom.writeToFile(
doc
, 'ec_' || p_Order_No || '.xml'
v_Filenme := p_Order_No || '.xml';
v_FilePath := 'ec_' || p_Order_No || '.xml';
xmldom.freeDocument(doc);
At the moment the xml file is saved, but to the default oracle directory.
Why doesn't this work?:
xmldom.writeToFile(
doc
, XMLDIR || 'ec_' || p_Order_No || '.xml'
Do I need to declare this directory somewhere in my package, or do I need to prefix it with
some command to be able to access it?
Any info or example would be most welcome.
Thanks,
Francois
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getRealPath
use the following in you jsp
<%=application.getRealPath("/")%>this will give you the application root directory.
Similar Messages
-
hi all
i use developer6i ,client/server mode,win2000
i want to get directory name of my fmx files,
for example if my fmx files are in this locatin ---> d:\xxx
i want to get this path in runtime .
is there any solution in form6i for my problem?
if you have any idea or an example code for this problem
please help me.
i 'd really appreciate it .
thanks
shoja
([email protected])I am a bit curious why you need to do it. Do you want it for use in CALL_FORM, NEW_FORM, OPEN_FORM etc. If so, your application would be more portable if you omit the path altogether and rely on the configuration of the runtime environment to provide it.
-
Get Directory name in Chinese and Chinese chars to Excel
Hi,
<b>Question:1</b>
I use "cl_gui_frontend_services=>directory_browse"
to get the Directory name from the presentation server.
It works good for the directory names in English.
However I need to perform a similar operation when the
user has logged in "<b>Chinese</b>" at OS level,
say Chinese Version of Windows. In this case this FM
doesn't get properly the directory names in chinese.
This might be because the directory name is of type
string. is there any other way to achieve this?
SAP Ver: 4.7
<b>Question:2</b>
I need to download chinese description to an excel file from an internal table. I could able to achieve this when I use Chinese version of windows and log into SAP in <b>'ZH'</b>.
I agree that to see the chinese characters properly we may need to log in the chinese version of Windows. But I don't understand the reason that why do we need to log into chinese version of SAP? i.e 'ZH'. I have decla=red the description field as character in the internal table declaration and in the FM 'GUI_DOWNLOAD', I specify the file type as <b>'ASC'</b>. Any clues on this to get this executed being logged in <b>EN</b> version of SAP?
Thanks,
SivaHey there KCR875015,
It sounds like like you need to change the language your iPad is set to, but you cannot understand the language it currently is. The following article should help you do that:
iOS: How to change the language when it's set to one you don't understand
http://support.apple.com/kb/ht2371
Thank you for using Apple Support Communities.
All the best,
Sterling -
Hi there,
I am writing an application to read the contents of a user specified directory. What I am wondering is, if I specify the cd-rom drive for example, is there any way of getting the 'title' of the cd, ie what would appear in windows explorer next to the drive letter eg 'media_name [E:]'. I have looked through the java.io.File class in the API, however, all I could find that might be relevant is getName(), but this only returns the file name eg E:\ in this case.
If anyone has any ideas it would be greatly appreciated.
ThanksI do not have a CDROM on this computer, so I do not know if this is what you completely want, but here goes:
import javax.swing.filechooser.*;
import java.io.*;
public class FileViewTest
public static void main(String[] args)
File f = new File("c:/");
FileSystemView fsv = FileSystemView.getFileSystemView();
System.out.println(fsv.getSystemDisplayName(f));
}When I ran this the output was: Local Disk (C:) -
Function Module to get directory on F4
Hello Experts,
Is there a FM to get Directory name on selection screen when the users hit F4, kinda like "KD_GET_FILENAME_ON_F4" for getting the filename?
Thanks.AT SELECTION-SCREEN ON VALUE-REQUEST FOR path.
DATA: l_dir TYPE string.
* Browse the Directories
CALL METHOD cl_gui_frontend_services=>directory_browse
* EXPORTING
* WINDOW_TITLE =
* INITIAL_FOLDER =
CHANGING
selected_folder = l_dir
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4
this is what you need i guess.. -
How do U to get the names of all files in a directory?
Is there a simple way to get all names of the files in a directory and put them in an array of Strings? Sounds simple, but I don't have a clue how to do this. Thanks.
Hi Kindoo,
Create a instance of File object using the path of the Directory
File fileDir = new File(directoryPath);
To get the List of all the files in the directory use
String[] strFiles = fileDir.list();
This will solve your problem,
Cheers
Nagaraj -
Get filename and directory name during runtime
Hi guys,
I am developing a file to file interface without content conversion, just a simple file transfer from one ftp server to another. I have to read the same filename (invent.txt) from multiple folders (mstransfer/M01/IN1, mstransfer/M02/IN1, mstransfer/M03/IN1....) that represent different stores and transfer it as it is with the same name to exactly the same directory name in the target ftp location.
My problem is found inside a dummy mapping that I have created in order to specify the target directory and the name of the file. I am doing the following:
A) A Java UDF to specify the filename
trace = container.getTrace();
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String filename = conf.get(key);
trace.addWarning("filename = "+filename);
conf.put(key, filename);
return "";
//return filename;
B) A Java UDF to specify the directory name
//write your code here
trace = container.getTrace();
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String directory = conf.get(key);
trace.addWarning("directory before = "+directory);
directory = "/usr/sap/trans"+directory;
trace.addWarning("directory after = "+directory);
conf.put(key, directory);
return "";
//return "/usr/sap/trans"+directory;
In receiver file adapter I do not specify neither a filename nor a target directory.
When I am testing it, I always get a mapping runtime error.
Any ideas?
--EvaggelosGuys,
First of all, I am doing an end to end testing, i.e. I let the FTP adapter pick the file up and another FTP adapter delivers the file to target folder. I am definitely not testing the mapping in mapping editor.
I get the error in Request message mapping (pipeline step, which I can see in SXMB_MONI transaction) which is a dummy mapping between two message types that I have created and are based on two data types with two fields each.
The UDF's that I have created go in-between the source and target fileds of the message types/data types.
The error that I see in the trace section of the XML message in SXMB_MONI is the following:
"<Trace level="1" type="T">RuntimeException during appliction Java mapping com/sap/xi/tf/_MM_G_SRS_FileTransfer_MNS_</Trace>
<Trace level="1" type="T">java.lang.NullPointerException at com.sap.aii.mappingtool.tf3.AMappingProgram.exceptionCaught$(AMappingProgram.java:59) at com.sap.aii.mappingtool.tf3.Transformer.checkParserException(Transformer.java:182) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:149) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:64) at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:91) at com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:95) at"
I have included some trace.addWarning() lines in Java code to help me debug my code, but I cannot see them anywhere inside the trace to be getting executed.
I will try Bhavesh's idea and I will write the code in the Java Section of my message mapping ( either Intialization or Destrcution ) section. -
How do I get the directory name from my program?
Hi,
I want to indentify the directory name where my executable is running from the program.
Is there any API similar to GetCurrentDirectory in Windows.
Thanks,
RamI think you may be looking for the getcwd(3C) call.
That call will get you the current working directory
for your process. See the man page for details (man
getcwd).
Alan
Sun Developer Technical Support
http://www.sun.com/developers/support -
How do I get the directory name that a class is located in?
How do I get the directory name that a class is located in? I have a class located under /com/dhcmc and I want to be able to retrieve the "/com/dhcmc" that the class is residing under so that I can then use this directoy name to build a relative path name for the other directories supporting the application such as the images directory etc i.e.
|---com
| \---dhcmc (my class resides here)
| +---images (supporting app dirs under the class dir)
| +---config (supporting app dirs under the class dir)You can try the methods.
Class.getClassLoader()
Class.getResourceAsStream()
Class.getResource()
You probably wont get the complete directory path, but you might
be able to load the files relative to your classes directory. -
Hi, Im trying to get the whole path in my server, so i tried that with this following code
Get-ChildItem $sourceFolder -Recurse | ?{$_.PsIsContainer} |Get-Acl
But then, it showed me somtehing like this :
Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
I tried to find the solver everywhere and mostly they propose to change the path name, which is impossible, since I am working with my company server, and those folder have already there before i start to work here, then the other ask me to use robocopy,
but all of the trick just dont work
is there any way to solve this problem? thanksThere is no simple solution to this. And it is not a limitation of powershell itself, but of the underlying NTFS file system.
If the problem is that a folder with a name longer than 248 exists anywhere within your directory structure, you are hooped.
If the problem is that some fully qualified path names exceed 260 characters, then, in those cases, the solution already given is to create a psdrive partway up the path from the drive letter or server/share root of the path. Unfortunately, the output produced
will be relative to that psdrive and not to what is specified as the $sourcefolder.
unless you already know where those problematic paths are, you might consider trying to trap those errors and have your script figure out where it needs to create psdrives. You might then be able to calculate the equivalent path for each file or folder and
output that. the programming effort would be simpler to just created a psdrive for each folder encountered, however I expect that would be very inefficient.
Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate. -
How to get the directory name using vnode address
All,
I am writing a C program and need info on the following:
1. I have got the vnode address of the current directory. my question is "How to get the inode information (in particular, directory name) from the vnode address ?". What calls i need to use in order to get the info ?
2. Any helpful web sites containing the above information ?
Thanks in advancepackage x.y;
import java.io.File;
public class Test {
public static void main(String[] args) {
System.out.println(new File(Test.class.getResource("").getFile()).getAbsolutePath());
} -
I am unable to uninstall this high risk addon shown below in Firefox Ad Data
Index of file:///C:/Users/lago/AppData/Roaming/SpecialSavings/
Up to higher level directory
Name Size Last Modified
File:SpecialSavings_2.0.0.crx 25 KB 19-Aug-12 6:03:42 PM
Anyone know how to get rid of it please?I am unable to uninstall this high risk addon shown below in Firefox Ad Data
Index of file:///C:/Users/lago/AppData/Roaming/SpecialSavings/
Up to higher level directory
Name Size Last Modified
File:SpecialSavings_2.0.0.crx 25 KB 19-Aug-12 6:03:42 PM
Anyone know how to get rid of it please? -
Impdp: looks right, but still getting ORA-39087: directory name invalid
This is fairly mysterious, particularly since I've done this many other times without problems.
I created the directory C:\OracleImportTest on the server's filesystem, created a corresponding directory object DP_DIR in Oracle, and granted my user read and write access to it. I've been staring at it and trying different things all morning, but I still get the following results:
C:\test>impdp cgernon/**** DIRECTORY=dp_dir SERVICE_NAME=test1 DUMPFILE=export.dmp LOGFILE=import.log
Import: Release 11.1.0.6.0 - Production on Friday, 27 May, 2011 12:01:08
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Release 11.1.0.6.0 - Production
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39087: directory name DP_DIR is invalid"But Mercurial!" you say, "surely you screwed something up setting up the directory and either it doesn't exist or you don't have access to it!" I would be the first to agree that is the most likely cause of the problem, but performing the following queries to double-check leaves me in a state of complete confusion:
select * from all_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
SYS DP_DIR C:\OracleImportTest
select * from user_tab_privs where table_name = 'DP_DIR';
GRANTEE OWNER TABLE_NAME GRANTOR PRIVILEGE GRANTABLE HIERARCHY
CGERNON SYS DP_DIR SYS READ NO NO
CGERNON SYS DP_DIR SYS WRITE NO NO Does anyone know of any other conditions that can trigger this error, or see anything I'm missing here? I am thoroughly mystified. Thanks!Good suggestion, but I'm still getting the same error ... using that command, as typed above.
HOWEVER, changing the command as follows works:
impdp cgernon/****@test1 DIRECTORY=dp_dir DUMPFILE=export.dmp LOGFILE=import.logWhich brings up another question. In the past, I've used the SERVICE_NAME option to specify the TNS Name for the database instance I want to connect to. Is that not what this option actually represents? And if not, why was it working for me in the past?
At this point, I guess my original problem is resolved, but if anyone can explain the SERVICE_NAME option to me, I would appreciate it - thanks! -
Keep getting the following warning from TB:
Bad key or directory name: "/desktop/gnome/url-handlers/GMT+01/command": `+' is an invalid character in key/directory names
Bad key or directory name: "/desktop/gnome/url-handlers/GMT+01/command": `+' is an invalid character in key/directory names
Running Scientific Linux 6.5 with all updates applied. Have restarted TB and still getting the above error message.
Application Basics
Name: Thunderbird
Version: 24.3.0
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
Profile Directory: Open Directory
(Local drive)
Application Build ID: 20140204141004
Enabled Plugins: about:plugins
Build Configuration: about:buildconfig
Crash Reports: about:crashes
Memory Use: about:memory
Mail and News Accounts
account1:
INCOMING: account1, , (none) Local Folders, plain, passwordCleartext
account2:
INCOMING: account2, , (imap) mutilate.local.davenjudy.org:143, alwaysSTARTTLS, passwordCleartext
OUTGOING: mutilate.local.davenjudy.org:25, plain, none, true
account5:
INCOMING: account5, , (imap) mutilate.local.davenjudy.org:143, alwaysSTARTTLS, passwordCleartext
OUTGOING: mutilate.local.davenjudy.org:25, plain, none, true
Extensions
Disable "You", 1.1, true, {79F88CCE-DC6B-11DE-A153-58A455D89593}
Important Modified Preferences
Name: Value
accessibility.typeaheadfind.flashBar: 0
browser.cache.disk.capacity: 358400
browser.cache.disk.smart_size_cached_value: 358400
browser.cache.disk.smart_size.first_run: false
browser.cache.disk.smart_size.use_old_max: false
dom.max_chrome_script_run_time: 0
extensions.lastAppVersion: 24.3.0
gfx.blacklist.direct2d: 4
gfx.blacklist.layers.direct3d10: 4
gfx.blacklist.layers.direct3d10-1: 4
gfx.blacklist.layers.direct3d9: 4
gfx.blacklist.layers.opengl: 4
gfx.blacklist.stagefright: 4
gfx.blacklist.suggested-driver-version: <Anything with EXT_texture_from_pixmap support>
gfx.blacklist.webgl.angle: 4
gfx.blacklist.webgl.msaa: 4
gfx.blacklist.webgl.opengl: 4
mailnews.database.global.datastore.id: 9e7fa03a-eac3-4c8e-9c6c-9017d15eb61
mail.openMessageBehavior.version: 1
network.cookie.prefsMigrated: true
places.database.lastMaintenance: 1393313146
places.history.expiration.transient_current_max_pages: 104858
plugin.importedState: true
plugin.soname.list: libXt.so
print.printer_CUPS/ML-1210.print_command: lpr
<Dwleted printer info to coserve space>
privacy.donottrackheader.enabled: true
Graphics
Adapter Description: X.Org -- Gallium 0.4 on AMD RS880
Vendor ID: X.Org
Device ID: Gallium 0.4 on AMD RS880
Driver Version: 1.4 (2.1 Mesa 9.2.0-devel)
WebGL Renderer: Blocked for your graphics card because of unresolved driver issues.
GPU Accelerated Windows: 0. Blocked for your graphics card because of unresolved driver issues.
AzureCanvasBackend: cairo
AzureFallbackCanvasBackend: none
AzureContentBackend: none
JavaScript
Incremental GC: 1
Accessibility
Activated: 0
Prevent Accessibility: 0
Library Versions
Expected minimum version
Version in use
NSPR
4.10.2
4.10.2
NSS
3.15.3
3.15.3 Basic ECC
NSS Util
3.15.3
3.15.3
NSS SSL
3.15.3
3.15.3 Basic ECC
NSS S/MIME
3.15.3
3.15.3 Basic ECCLooks like there is a key that isn't getting deleted when an account is deleted. I thought I had resolved the error message problem by removing my wife's account from my Thunderbird instance. Haven't seen it since the above post. Just got it again:
Bad key or directory name: "/desktop/gnome/url-handlers/GMT+01/command": `+' is an invalid character in key/directory names
Bad key or directory name: "/desktop/gnome/url-handlers/GMT+01/command": `+' is an invalid character in key/directory names
Weird.
Cheers,
Dave -
Getting Application root directory name dynamically
hi all,
For some reason I need to get Application root directory name dynamically
and use it somewhere.
Im using resin and default app dir is "doc" i've another directory "abc" and set
that as application root directory.
So from jsp i need to get the application root directory name.
thx in adv,
kiranhttp://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getRealPath
use the following in you jsp
<%=application.getRealPath("/")%>this will give you the application root directory.
Maybe you are looking for
-
App for iPhone stuck on "waiting", App for iPhone stuck on "waiting"
I have an iPhone 4 running the latest iOS version 5.1. I have two separate issues: 1. Within the last couple of weeks, I get the notification from App store that updates are available. I select the App for the store, select "update all" and all th
-
Using Firefox 19.02 When I receive an email with an Excel, Word, or PDF file attachment, and I click download, firefox opens up the associated program for all my users, however when you click on file>save-as you are not presented with the dialog box
-
Cannot view movie, screen goes black
Download movies from itunes (usually with difficulty...doesn't seem to want to transfer on 1st or more tries). Once I get the movie, the screen goes black part way through viewing. At this point, video folder also shows a black screen. Took ipad b
-
HT204291 Can anyone explain why every wi-fi device in my house works - apart from apple tv?
This is my routine: 1. Enable Home Sharing 2. Select film 3. Play film, begin to enjoy 4. 5 - 10 mins later, film cuts out, Apple TV 2 reports that its lost Home Sharing 5. Disable Home Sharing in Itunes 6. Repeat proces
-
Hi All, Can anyone tell me why the web site at linksys is now showing firmware version 1.00.9 for WRT54G V5 dated May 2006? I have been to the site and picked up firmware version 1.01.1 dated Nov 2006 around Christmas. I went to check today to see if