Help needed in creating File Directory if not exist

hi, All
I am thinking about wite files to directories based on year, month, day. if the directory for that year or month or day exists already, do not create the directory, but write the file to that directory.
For example: 2003/02/22/file.txt --2003/02/22 exist, just write file.txt
If the directory does not exist, the program will create the direcotry and write the file into the right directory.
For example 2003/02/22/file.txt, ---2003/02/22/ does not exist, the program will create the directoies and write file file.txt
If anyone can provide any example or suggestion, I really appreciate!
Thanks
Steve

Hi!
Just have a look at the class "File"
and it's method "exists()".
Hope, that helps.
Thoto

Similar Messages

  • Help needed in creating file structure

    Hi friends,
    - <Validity>
      <Validity Time="1">12102010</Validity>
      </Validity>
    This is a node of an xml file which i need to use in my scenario.but i was stuck in creating data type for this node.how to create data type for this node?
    as at target side this field should be split into 2 fields validity and time

    Hello Kiran,
    To add something related to split, check this out.
    Re: Split a string
    Regards
    Pothana

  • Error in file receiver adapter (Directory does not exist / cannot be create

    I have a NFS reiceiver file NFS adapter with target directory:
    10.128.68.38\arbo2000\UploadPinfos\arbodev
    if I run this line in windows, windows access to this folder.
    Full Error log:
    Receiver Adapter v2123 for Party '', Service 'BS_0000_ARBO_DEV':
    Configured at 2006-04-06 18:08:26 CEST
    History:
    - 2006-04-06 18:08:35 CEST: Error: Message processing failed: Exception: Message processing failed - configuration error in file receiver adapter (Directory does not exist / cannot be created)
    Can somebody help me please??

    Hi Alvaro,
            If your XI server is running on Unix platform then you'll get the access only after mounting 10.128.68.38 this system as a drive. This is equivalent to the windows network mapping.
    Next thing is that once that is done then you can access the path /arbo2000/UploadPinfos/arbodev by mentioning it in your directory path.
    To check whether the above mentioned is the problem then pls do try by doing it with FTP protocol. If it works then for acting as a local directory for NFS you need to mount the drive.
    Cheers
    JK

  • Installed new update iTunes Saturday - My file directory could not be found, so reset the directory path, 'it' asked me if I would like 'it' to re organise filing, I selected yes - Many tunes have been duplicated, some have disappeared. Any help?

    Hi,
    Installed a new update iTunes Saturday - My file directory could not be found, so I reset the directory path, and 'it' asked me if I would like 'it' to re organise my filing, foolishly (as a beginner, without checking)  I selected yes - Many tunes have been duplicated, some have disappeared? Trawled through lots of misleading help files, mailed friends, tried many back routes into Apple web sites and they all wasted my time. Can anyone help?
    I have discovered since then, that this resorce has been down over the weekend, which probably explains why I have had so many contradictory responses, so apologies if you all know what the prolem is.
    My question is, my TIME MACHINE (which has not been used yet) was tried but looked nothing like that of the U Tube demo, so I am assuming that it needs setting up, however, it has been saving, I just do not know how to recover the data. Can anyone help?
    Regads,
    Cyfrommayo

    (If you have a Time Machine backup, go to your User folder/Music/iTunes and select iTunes. Enter Time Machine and go to a backup of iTunes before the above happened. Then select 'Restore' on the bottom right.)
    Eric,
    Many thanks for your help.
    Apologies for not being as skilled as you. I am unable to see what you are saying, can I ask, should I be in TIME MACHINE when I go to User folder/Music?iTunes or iTunes or Finder?
    Cyfrommayo

  • Can a directory to be created if it does not exist on FTP server?

    Hello SOA experts,
    We are good with most common usage of all Adapters. But recently, I am facing a challenge when archive files on FTP server.
    Archive files need to be placed into different folders for each month. For instance, ./archive/201308 for files archived in August. Next month, a new directory ./archive/201309 should be created, ideally automatically.
    My question is, can I do through some configuration and properties setting to let SOA create a remote target directory when it does NOT exist?
    We maintained multiple archive folders for different typr of documents. It is really a hassle to create them manually. And if the target directory does not exist, it would throw errors.
    Thank you very much in advance.
    Alena Li
    CGI

    Hi, After reading your post, I myself wanted to test this out. I thought that by configuring the following in the Adapter Wizard it would create the remote directory for me:
    <adapter-config name="FW" adapter="File Adapter" wsdlLocation="FW.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/FileAdapter"/>
      <endpoint-interaction portType="Write_ptt" operation="Write">
        <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
          <property name="PhysicalDirectory" value="C:\Archive"/>
          <property name="Append" value="false"/>
          <property name="FileNamingConvention" value="%SEQ%\test.txt"/>
          <property name="NumberMessages" value="1"/>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>
    It failed on my BPEL instance however I could see that it was trying to create the file. When I created all destinations it was able to create it.
    This is my recommendation from what I understand you'd like to accomplish:
    Create the different Year&Month folders on your destination from Jan to Dec:
    201301
    201302
    201303
    201304
    201305
    201306
    201307
    201308
    201309
    201310
    201311
    201312
    (You can actually create as many as you want going to 2090 if you want...
    Add the below config to your JCA File:
    <adapter-config name="FW" adapter="File Adapter" wsdlLocation="FW.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/FileAdapter"/>
      <endpoint-interaction portType="Write_ptt" operation="Write">
        <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
          <property name="PhysicalDirectory" value="C:\Archive"/>
          <property name="Append" value="false"/>
          <property name="FileNamingConvention" value="%yyyy.MM%\filename"/>
          <property name="NumberMessages" value="1"/>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>
    This will allow the files to be dynamically created in the correct directories.
    This is a work-around and I hope this works for you.

  • File adapter : Do not poll if directory does not exist

    Hi people !
    I have a BPEL process that takes files as Input messages.
    I use a file adapter to do that.
    It works well but I would like to avoid polling the directory if it does not exist, do you know how to control if the directory actually exists ?
    Here is the File Adapter configuration :
    <jca:operation
    PhysicalDirectory="PhysDir"
    ActivationSpec="oracle.tip.adapter.file.inbound.FileActivationSpec"
    PhysicalArchiveDirectory="ArchiveDirl"
    DeleteFile="true"
    IncludeFiles=".*\.xml"
    PollingFrequency="30"
    MinimumAge="0"
    OpaqueSchema="false" >
    </jca:operation>
    Even if the directory does not exist, the process endlessly tries to poll that directory.
    Thanks in advance,
    Romain.

    I do agree with you that the directory should exist because the adapter was configured to poll on that directory !!
    Nevertheless, I would like to know how to control its existence before polling...
    Romain.

  • Input File repository server Error: The requested directory does not exist.

    Hi,
    Getting following error "The requested directory does not exist." for Input and Out put file repository server.
    The specfied directory exists and the user has local administrative privelges with full control of the IFRS and OFRS location.
    The location was earlier working and after trying to implement Windows AD the things stopped. Have tried reverting the things but the following issue still persists.
    Thanks,
    Manpreet

    @Siva,
    I am not using the defacult FRS, I have specfied a specfic location on which the user has full control.
    this was working prior to the Windows AD setup tried by me.

  • SSPU issue: Cache directory does not exist, and couldn't create a new downl

    I have installed SSPU and created an offer over there. When I run my offer it gives the error:
    Cache directory does not exist, and couldn't create a new download cache directory.
    Can anyone tell me the root cause and workaround for this issue?

    Hi
    Try deleting the "offer" directory from SSPU home and then delete the offer from Sub-Client . Restart client and then add the provider . Start pushing the content from SSPU and see if the issue still persists .
    Thanks
    Srinath

  • Src/wwu directory does not exist

    Chapter 3 of three of the Single Sign-on Administrator's Guide (Rel. 3.0.9) refers to 'ssoexp.csh' in the "src/wwu directory in
    which Portal is installed". What are they talking about?
    I found an "ssoexp.csh" in ".../Portal30/admin/plsql/wwu" that I am going to use.
    Does this mean my Portal install was done wrong? Or is the documentation off?
    TIA

    Hi,
    I tried to change the directory for DIR_TRANS but I encountered the error directory does not exist. The directory is something like that
    switest\sapmnt\trans. Anything went wrong?
    Ideally the share
    switest\sapmnt points to the location <drive>:/usr/sap/
    Taking your case , sapmnt should point to
    switest\<Drivename>\usr\sap.
    So will be need to ensure that this location is shared as sapmnt and you have created a folder trans under this location.
    Hope this helps.
    Regards,
    Deepak Kori

  • "recover database until cancel" asks for archive log file that do not exist

    Hello,
    Oracle Release : Oracle 10.2.0.2.0
    Last week we performed, a restore and then an Oracle recovery using the recover database until cancel command. (we didn't use backup control files) .It worked fine and we able to restart the SAP instances. However, I still have questions about Oracle behaviour using this command.
    First we restored, an online backup.
    We tried to restart the database, but got ORA-01113,ORA-01110 errors :
    sr3usr.data1 needed media recovery.
    Then we performed the recovery :
    According Oracel documentation, "recover database until cancel recovery" proceeds by prompting you with the suggested filenames of archived redo log files.
    The probleme is it  prompts for archive log file that do not exist.
    As you can see below, it asked for SMAarch1_10420_610186861.dbf that has never been created. Therefore, I cancelled manually the recovery, and restarted the database. We never got the message "media recovery complete"
    ORA-279 signalled during: ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10417_61018686
    Fri Sep  7 14:09:45 2007
    ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10418_610186861.dbf'
    Fri Sep  7 14:09:45 2007
    Media Recovery Log /oracle/SMA/oraarch/SMAarch1_10418_610186861.dbf
    ORA-279 signalled during: ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10418_61018686
    Fri Sep  7 14:10:03 2007
    ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10419_610186861.dbf'
    Fri Sep  7 14:10:03 2007
    Media Recovery Log /oracle/SMA/oraarch/SMAarch1_10419_610186861.dbf
    ORA-279 signalled during: ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10419_61018686
    Fri Sep  7 14:10:13 2007
    ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10420_610186861.dbf'
    Fri Sep  7 14:10:13 2007
    Media Recovery Log /oracle/SMA/oraarch/SMAarch1_10420_610186861.dbf
    Errors with log /oracle/SMA/oraarch/SMAarch1_10420_610186861.dbf
    ORA-308 signalled during: ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10420_61018686
    Fri Sep  7 14:15:19 2007
    ALTER DATABASE RECOVER CANCEL
    Fri Sep  7 14:15:20 2007
    ORA-1013 signalled during: ALTER DATABASE RECOVER CANCEL ...
    Fri Sep  7 14:15:40 2007
    Shutting down instance: further logons disabled
    When restaring the database we could see that, a recovery of online redo log has been performed automatically, is it the normal behaviour of a recovery using "recover database until cancel"  command ?
    Started redo application at
    Thread 1: logseq 10416, block 482
    Fri Sep  7 14:24:55 2007
    Recovery of Online Redo Log: Thread 1 Group 4 Seq 10416 Reading mem 0
      Mem# 0 errs 0: /oracle/SMA/origlogB/log_g14m1.dbf
      Mem# 1 errs 0: /oracle/SMA/mirrlogB/log_g14m2.dbf
    Fri Sep  7 14:24:55 2007
    Completed redo application
    Fri Sep  7 14:24:55 2007
    Completed crash recovery at
    Thread 1: logseq 10416, block 525, scn 105140074
    0 data blocks read, 0 data blocks written, 43 redo blocks read
    Thank you very much for your help.
    Frod.

    Hi,
    Let me answer your query.
    =======================
    Your question: While performing the recovery, is it possible to locate which online redolog is needed, and then to apply the changes in these logs
    1.   When you have current controlfile and need complete data (no data loss),
          then do not go for until cancel recovery.
    2.   Oracle will apply all the redologs (including current redolog) while recovery
         process is    on.
    3.  During the recovery you need to have all the redologs which are listed in the    view    V$RECOVERY_LOG and all the unarchived and current redolog. By querying  V$RECOVERY_LOG  you    can find out about the redologs required.
    4. If the required sequence is not there in the archive destination, and if recovery process    asks for that sequence you can query V$LOG to see whether requested sequence is part of the    online redologs. If yes you can mention the path of the online redolog to complete the recovery.
    Hope this information helps.
    Regards,
    Madhukar

  • ERROR: Cannot start mail services, configuration directory does not exist

    I'm running an Xserve G5 with one internal boot drive and one RAID using the other two internal drives. I used Apple's Disk Utility to set-up the RAID.
    Back in early December, I moved my mail database and mail store to the RAID. Ever since, when I restart the server, the mailaccess.log generates the following error:
    Jan 23 18:51:33 mail master[47]: ERROR: Cannot start mail services, configuration directory does not exist: /Volumes/RAID/mail.data/db
    I'm speculating this is a timing error that gets created when Postfix initially can't find the RAID. Then, it must try again and find it because the error message does not repeat and mail starts running.
    Is this something to worry about?

    Hi Joel,
    You're right, it's a timing issues. The mail system is ready for work before the file system is mounted. It's benign.
    Jeff

  • Error when trying to install the adobe creative suite exit code 39.I get the following error message Directory does not exist : /Applications/Utilities/Adobe Application Manager/DECore/DE6/resources/uninstall/Uninstall Product.app

    i have run the adobe cleaner , repaired disk permission and also tried to download and install several times.
    this is a mac osx running the yoshmite
    please help
    this is the error
    Exit Code: 39
    Please see specific errors below for troubleshooting. For example,  ERROR: DW042 ...
    -------------------------------------- Summary --------------------------------------
    - 0 fatal error(s), 2 error(s)
    ERROR: Directory does not exist : /Applications/Utilities/Adobe Application Manager/DECore/DE6/resources/uninstall/Uninstall Product.app
    ERROR: DW042: ARP Entry couldn't be created for language : en_US

    Oliviat14nov does /Applications/Utilities/Adobe Application Manager/DECore/DE6/resources/uninstall exist on your computer? 

  • Deploying custom page to MDS respository: The root directory does not exist

    Hi,
    with XMLImport, I have
    java oracle.jrad.tools.xml.importer.XMLImporter /u01/jdevhomes/sjallerat/jdevhome/myprojects/technip/oracle/apps/xxepc/deploying/webui -jdk13 -mmddir "/u01/jdevhomes/sjallerat/jdevhome/myhtml/OA_HTML/jrad" -username apps -password venus -rootdir /u01/jdevhomes/sjallerat/jdevhome/myprojects -validate -dbconnection "(description = (address_list = ( address =(protocol = tcp)(host = xxxxxxxxxxxxxxxxx)(port = xxxx)))(connect_data = (sid = xxxx)))"
    Importing /technip/oracle/apps/xxXXX/deploying/webui/EpcTestMessagesPG
    Error: The root directory does not exist.
    xxXXX is new. With existing app, add one module .xml is OK.
    Thank you for yor help.
    Serge

    We have registered XXYYY as a new application in our instance of oracle application with a basepath = XXYYY_TOP.
    And add in Linux's file xxxxxx.env the declaration : XXYYY_TOP with rootpath = /xxxxxxx/oracle/xxxappl/XXYYY/11.5.0.
    Let us must be made another statement in another file?
    Thank you.

  • ~/oradiag_$USER/.. and "Directory does not exist for read/write" issue

    Hi.
    Recently I've discovered that ADR was creating a folder in one of ours Oracle 11.2.0.1 server, in the users home like ~/oradiag_$USER/.. The problem is that this logging files dont stop growning, and they are filled only with this lines:
    Wed Apr 11 13:40:06 2012
    Directory does not exist for read/write [usr/oracle/product/11.2.0/log] [usr/oracle/product/11.2.0/log/diag/clients]
    Wed Apr 11 13:40:06 2012
    Directory does not exist for read/write [usr/oracle/product/11.2.0/log] [usr/oracle/product/11.2.0/log/diag/clients]
    Wed Apr 11 13:40:06 2012
    Directory does not exist for read/write [usr/oracle/product/11.2.0/log] [usr/oracle/product/11.2.0/log/diag/clients]
    Wed Apr 11 13:40:06 2012
    Directory does not exist for read/write [usr/oracle/product/11.2.0/log] [usr/oracle/product/11.2.0/log/diag/clients]
    Wed Apr 11 13:41:06 2012
    Directory does not exist for read/write [usr/oracle/product/11.2.0/log] [usr/oracle/product/11.2.0/log/diag/clients]
    etc
    I've searched around internet about this issue all that I've found is a "workaround" by creating those folders. And yep, it works, it stops growning.
    Then I checked the others servers that we have, and the problem replicates in some servers with the same Oracle version.
    My question is: Why this? Why in some servers ADR is looking for that folder? That folder didnt exist in any of them, but only some servers tries to read/write on it (or, at least, log it) What parameter relies on it?
    Regards.

    Metalink note
    11g Sqlnet Log Shows Error "Directory does not exist for read/write" [ID 797678.1]
    Errors Filling log.xml and sqlnet.log: Directory does not exist for read/write [opt/oracle/oemagent/agent11g/log] [ID 1291286.1]

  • The Specified Directory Does not Exist

    Hi expert
    could you help me with my problem , this word " The Specified Directory  Does Not Exist" its some stupid question , isn't it ?
    this is my sitiuation    :
    1.  BPC version is SAP BPC 5.0.512
    2. we are using  MS Excel 2003
    our user  do some modification from BPC  WEB (the BPC open excel file with many macro and add-in etc ...  ), then user save using Save Dynamic Template  sub menu from eTools menu , and raise message "The Specified Directory Does not Exist < directory path>/eEXCEL. "
    the questions Are .
    1. Could anyone explain why BPC try to save in Client Local Direcory not is BPC Server 
    2. Could  anyone help me how to resolve the problem ?
    (i am appolagize with my bad english )
    thanks.

    HI nvsleman ,
    I had the same problem and I manually copied the eExcel folder (on my local harddrive) from a working application to the application in question.
    Hope this helps
    Sabine

Maybe you are looking for