How to check whether a file is present in the UNIX directory of app. server
Hi,
I am creating files in the UNIX directory in the application server using :
CONCATENATE '/sapmnt/RD1/interfaces/client670/'
p_fname '.CSV' INTO w_filename.
OPEN DATASET w_filename FOR OUTPUT IN TEXT MODE.
LOOP AT t_output1.
TRANSFER t_output1 TO w_filename.
ENDLOOP.
CLOSE DATASET w_filename.
I am unable to check whether a file with the same name exists or not. How to check the duplicate state of the file.
You can use the following fm
RZL_READ_FILE
or
use OPEN DATASET FOR INPUT.
Similar Messages
-
How to check whether a file exist in the program folder or not?
Hi guys,
how to check whether a file exist in the program folder or not? Let is say i recieve a file name from user then i want to know if the file is there not and act on that base.
abdulLook at the class java.io.File and the .exists() method:
http://java.sun.com/j2se/1.4/docs/api/java/io/File.html -
how can I convert .pdf file to .doc using the free adobe reader app? when I try to convert the .pdf file it asks me to sign in. when I click on "sign in", I am taken to a service subscription page. So, no free conversions using free adobe reader app?
As has been mentioned Adobe Reader cannot export PDF page content. Nor can it create PDF or manipulate PDF page content.
What you can do is use one of Adobe's online subscription services. Two provide for PDF to Word export.
There's ExportPDF and PDF Pack.
Be well... -
How to check whether a file got read permissions for perticular user
Problem: Let JRE is running with some x as effective user in LINUX then while checking file permission it is checking permission on that file for that x user.
File f = new File(�file name�)
if(f.exists())
System.out.println(�exists�);
Else
System.out.println(�does not exists�);
The above code prints exists only when x user have permissions on that file
Requirement: I would like to check whether a file got read permissions for particular user i.e. whether y user got permissions on that file.
Any help is appreciatedIn Linux a user has to have read permission on a file to even see that it exists. As a result, if a user (or a group to which they belong) doesn't have read access to the file File.exists() will return false. Windows which doesn't have as tightly controlled access to files will admit that a file exists whether it can be read or not.
PS.
This is proof that I should never answer a question off the top of my head when I haven't had my red bull yet. This is wrong. You will be able to see it if you have read and execute on the directory.
thumps self in head
Message was edited by:
puckstopper31 -
How to check whether a file in AL11 is unicode or non-unicode
Hi All,
I have a file in AL11. Now before using open dataset, i need to check whether it is unicode or not. By doing this we will know what encoding format needs to be used with open dataset statement.
Do we have any way by which we can programatically check whether a file in AL11 is unicode or not.
Thanks,
TirthHi,
The code is as follows:
IIndexService indexService = null;
try {
indexService = (IIndexService) ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
} catch (ResourceException e) {
if (indexService == null) {
log.errorT("Error on instanciating the index service");
return this.renderMessage(this.getBundleString(RES_NO_INDEX_SERVICE), StatusType.ERROR);
// get index
IIndex index = null;
try {
index = indexService.getIndex("YourIndexID");
} catch (WcmException e1) {
log.errorT("Error when trying to get the index");
return this.renderMessage(this.getBundleString(RES_NO_INDEX), StatusType.ERROR);
// check if the index is a instance of AbstractClassificationIndex
AbstractClassificationIndex classiIndex = null;
if (index instanceof AbstractClassificationIndex) {
classiIndex = (AbstractClassificationIndex) index;
} else {
log.errorT("The index " + index.getIndexName() + " is no classification index");
return this.renderMessage(this.getBundleString(RES_NO_CLASSIFICATION_INDEX), StatusType.WARNING);
//give your KM Resource here for which you want to know if it is classified or not
boolean classified = classiIndex.isDocClassifiedInAnyTax(resource);
Regards,
Praveen Gudapati -
Download Excel file in the Unix directory of Application server
Hi Friends,
I have a requirement of downloading the Excel file in the Unix directory path of the application server,i just need your inputs,it would be great help if you can send any sample coding for downlading the file in the Unix directory?
Regards
DineshYou can use the following fm
RZL_READ_FILE
or
use OPEN DATASET FOR INPUT. -
How to check whether entity has been persisted in the current transaction
Hello,
I am porting functionality which relay heavily on lifecycle of the entity.
For example methods like these:
* returns true if the instance has been modified, deleted or newly made
* persistent in the current transaction
public boolean isModified(final EntityObject entity)
public boolean isDeleted(final EntityObject entity)
For some of these callsI have found how to port them to toplink und just want to validate that this is the right way:
protected static UnitOfWork getUnitOfWork(EntityManager entityManager) {
return ((JpaEntityManager) (entityManager.getDelegate())).getUnitOfWork();
public static boolean isModified(EntityManager entityManager, Object entity) {
UnitOfWorkChangeSet set = getUnitOfWork(entityManager).getCurrentChanges();
ObjectChangeSet oset = set.getObjectChangeSetForClone(entity);
return !oset.getChanges().isEmpty() || oset.isNew();
public static boolean isDeleted(EntityManager entityManager, Object entity) {
UnitOfWorkChangeSet set = getUnitOfWork(entityManager).getCurrentChanges();
return set.getDeletedObjects().keySet().contains(entity);
but I did not find how to do following with the eclipselink:
* returns true, if the given entity object has been persistet during the
* current transaction
* @param entity
* @return true, if the given entity object has been persistet during the
* current transaction
public boolean isPersistent(final EntityObject entity)
Questions:
- how can I check whether the entity is persistent in the sense already stored in the DB ?
- how can I check whether the entity has been persisted in the current transaction ?
Thanks in advance.
Andre TeshlerHi Andre,
In Eclipse link there are Entity listeners which will define the life cycle events like preInsert(),postInsert() etc.On successful insertion of an object its postInsert() life cycle method gets called.If you have to validate whether object inserted successfully then best place is to override the postInsert() and check for the existence of the record.All the event life cycle methods take a DescriptorEvent as parameter which will give handle to API as given below.In the same method you can check if this insert operation succeeded in the same transaction.
package model;
import java.util.Vector;
import org.eclipse.persistence.descriptors.DescriptorEvent;
import org.eclipse.persistence.descriptors.DescriptorEventAdapter;
import org.eclipse.persistence.descriptors.DescriptorEventListener;
import org.eclipse.persistence.internal.sessions.ObjectChangeSet;
public class SampleEntityLIstener extends DescriptorEventAdapter {
public SampleEntityLIstener() {
super();
public void postInsert(DescriptorEvent event) {
event.getRecord().containsKey("pass the object");
event.getChangeSet().getUOWChangeSet();
public void preInsert(DescriptorEvent event) {
Once you implement the DescriptorEventListener,need to register with the Entity so that life cycle methods gets called and respective business logic gets executed.
Hope this helps,
Regards,
P.Vinay Kumar -
Using FILE to interact with the CI from an App server
Hi All.
We have a custom code function where a user takes a text file and uploads it into the SAP system. The file is immediately processed and a new 'outbound' file is created. Currently, we have the dirctory structure set-up on out CI/DB server. Our users access the system from one of 2 application servers.
The issue we have is that due to the definition in FILE, when the users execute the report, it errors out. This is becasue when they execute, SAP looks to the local server - the app servers - for the directory. As stated, this directory lives on the CI. Does anyone know how to adjust the functionality of FILE so that I can point the program to execute on the CI and not the app server? Thanks!Hello Tim,
We have a similar scenario like you but dont face this issue. 2 things are imüportant here:
1. The directory residing on CI should be accessible from the other application server i.e the mount should be correct.
2. The logical file path name in FILE should be correct. This is very important.
Believe me we have a more complex arrangement where 5 SAP s are involved and the directory resides on only one of them
Also FILE cannot dicate on which system the program is executed.It purely depends on the app server where the user is logged in.
Regards.
Ruchit. -
How to check whether a file exists or not
i am in an image uploading utility. i hav succesfully uploaded the image to the server directory (say /uploads). but when displaying the uploaded image, i wanna show the picture only if the image exits (bcoz for some records there is no image). so i hav used this code
if(new File("uploads/1.jpg").exists())
out.print("image exists");
but its not working for me. i got it working fine when i give the full path "D:/Tomcat/webapps/diary/admin/uploads/1.jpg". but i think giving this absolute path is not an efficient method bcoz its a web application, bcoz i may not be able get the absolute path always. so how can i do this by specifieing the relative path
help me ASAP if u can
aleensHaii ameen
This is one way to rectify your problem..
if(new File("uploads/1.jpg").exists())
out.print("image exists");
instead of this u can write like
<%
ServletConfig cf=getServletConfig();
ServletContext c=cf.getServletContext();
if(new File(c.getRealPath("uploads")+"/test.txt").exists())
out.print("image exists");
%>If u are not clear of what it is done let me know..i will xplain to you furthur...
Happy New Year
Shanu -
How to check whether INSO Filer is being used or not?
Hi,
We have created full text search indexes using the default syntax -
CREATE INDEX FTI ON DOCUMENTS(DOC_FILE) INDEXTYPE IS CTXSYS.CONTEXT;
How can I find out whether the INSO filter is used or not. Also a basic question, INSO filter helps in reading and "crawling" some 100+ document formats and creating an index against which search could be executed.... right?
Please do let me know.
Thanks & Regards,
Dhwanilyou can specify the inso filter in index code creation.
create index TEST_IDX
on TEST_TABLE (TEXT)
indextype is ctxsys.context
parameters('filter ctxsys.inso_filter'); -
How to check whether Weblogic is hung /up with a Unix script
Hi
I would like to write a script for monitoring the weblogic server. I want to have a script that checks the weblogic once in a while if it's up and running. if not running, will send an email to me
Please tell me what is that file name in weblogic that tells me this thing .
Thanks for reading.This can't be answered without knowledge of your environment and how you run your WLS (version ?).
The simplest way is to use a pgrep unix command and check for the right process (i.e. the name of the wls server).
You have to keep in mind, that there might be several processes (i.e. one for the node manager one for each server).
Timo -
Send a file that resides above the virtual directory to the browser using ASP.
How do you send a file that resides above the virtual
directory to the browser using ASP.
this doesn't work:
<% Response.Redirect(Server.Mappath("..\..\..\files\"
& rsgetefile("filename"))) %>Basically you can't send a person to the location as that
would totally
defeat the purpose of placing files above the virtual root.
You can stream a
file from a page on the site if you use the physical location
on the server
to call it.
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"lovewebdev" <[email protected]> wrote in
message
news:ec2paf$9ht$[email protected]..
> How do you send a file that resides above the virtual
directory to the
> browser using ASP.
>
> this doesn't work:
> <% Response.Redirect(Server.Mappath("..\..\..\files\"
> rsgetefile("filename"))) %>
> -
How to check whether there r new txt files in a folder n file creation date
How to check whether there r new text files in a specified folder and what is the date of creation of the text file.........?
Hi
I have been searching for a solution to find the date of creation of a file for over 6 months now but haven't found it. So I presume that it is not possible though I havent found any authentication of my assumption in any document.
Cheers!
Shailesh -
How to check Whether the File is in Progress or used by some other resource
Hi All,
I am retrieving a file from the FTP server using Apache commons FTP.
I need to check whether the file is fully retrieved or in progress.
for now i can able to use the file which is partially retrieved. it is not throwing any file sharing exception or i am unable to find whether it is in progress.
How to check whether the file is in progress ? or The file is accessed by some other resource ?
Pls Help me.
Thanks,
J.KathirHi Vamsi,
Explicitly such kind of requirement has not been catered and i dont think you would face a problem because any application that is writing to a file will open the file in the read only mode to any other simultaneous applications so i think your concerns although valid are already taken care off .
In the remote case you still face a problem then as a work around. Tell the FTP administrator to set the property to maximum connections that can be made to ftp as one. I wonder if you have heard of the concept of FTP handle , basically the above workaround is based on that concept itself. This way only one application will be able to write.
The file adapter will wait for its turn and then write the files.
Regards
joel
Edited by: joel trinidade on Jun 26, 2009 11:06 AM -
How to poll directory to check whether new file is added in plsql code
How to poll directory to check whether new file is added in plsql code
You can simply try opening that file for read in a loop (with some sleep in between). But in some OS (e.g. UNIX) file is accessible even if it is partially written. I suggest creating OK file (empty file with same name and OK as extension) after creating main file. This way PL/SQL code will be polling for OK file which means main file is completed.
SY.
Maybe you are looking for
-
I do not get any sound on videos from YouTube or any other video using flashplayer. I have Wndows Media Player installed and anything requiring Media Player for the audio is fine, so there is nothing wrong with my speakers or sound card. I have been
-
LK6.5 Modbus read/write to many addresses at once
LK6.5 Modbus read/write to many addresses at once. What happens as example; I have address 100 to 150 and 180-200. Addresses in between doesn't exist. Not all are connected. The modbus (Ethernet master) driver reads in a single command (in order to o
-
Nikon D7000 raw files will not open using PSE 11
I am unable to open Nikon D7000 raw files(NEF) using PSE 11 When I use the program's "Update "function I just get an error message. Can anyone advise? Thanks
-
The inbox for Mac Mail lists every incoming message twice. When I delete a message it deleted both entries. I have tried the solution in "help" and it doesn't work. Any suggestions?
-
Cannot get past License agreement
I cannot get past the license agreement page for my Ipod shuffle, I can download songs but I want to register and reset my Ipod, it appears that I cannot scroll right to click the next button..any ideas would be appreciated!