Search network directory for file JS CS3

I need to enhance a javascript that I created a while back, by adding the functionality to search a network drive for files.
I have been able to test for file exists on one of the volumes, but the other volume hasn't got the same stucture and needs a recursive search that drills down directories. and then back out to start the next set of folders.
Has anyone had call to do this themselves, and if so, could you please point me in the right direction?
Many thanks

Thanks for that Mark.
Every time I searched I didn't include 'recursive' and ended up with loads of discussions to choose from - yet I used the word in my question. I'm obviously working too hard!
Problem solved now, many thanks.
Andrew

Similar Messages

  • How to set a root directory for file management in web application

    Is it possible to set a default root directory for file management for a web application ?
    We would upload some files and store them in the web server.
    When we write the uploaded files without any path, the files are written in the config directory into the jdeveloper embedded oc4j directory.
    When we write the uploaded with a relative path ("/somedir/filename"), the files are written in C:/somedir/filename.
    We would like that all file management with relative path into the web application refer automatically to a given root directory (for example defined in web.xml).
    Is it possible ?

    I'm using the standard upload in adf faces.
    The problem is not during upload. This is managed in a temporay directory defined in web.xml. The problem is for writing the file that was uploaded (upload give us an inputStream we have to write somewhere, eventually after unzipping).
    Here is an example of our current code.
    if (mimeType.equals("application/x-zip-compressed") |
    mimeType.equals("application/zip")) {
    File destZipFile =
    new File(rootDirectory + "/" + parametersDirectory +
    "/" + uploadedFile.getFilename());
    BufferedInputStream isZipFile =
    new BufferedInputStream(uploadedFile.getInputStream());
    FileOutputStream fosZipFile =
    new FileOutputStream(destZipFile);
    BufferedOutputStream bosZipFile =
    new BufferedOutputStream(fosZipFile, BUFFER);
    // read and write until last byte is encountered
    while ((currentByte = isZipFile.read(data, 0, BUFFER)) !=
    -1) {
    bosZipFile.write(data, 0, currentByte);
    }

  • Search network drive for large files

    Our network drives are getting full. I used to be able to use Find File to find files larger than a certain size. I hit command-F for finding the file, have it set to search the volume I want for files with size greater than 80 MB, but when I hit return to start the search nothing happens--no spinning arrow showing that it's "thinking". I don't want to specify anything in the window with the magnifying glass, since I don't know file names. Any suggestions, or is this just something that you can't do with 10.4.8 (the version on my machine at work)?

    Never mind. I found out that if I add specific folders I want to search inside, it works. It just doesn't want to search the volume.

  • Search multiple folders for files with same name and create single file

     I have a project where I need to search multiple folders for a file name and when found append data from each file to a single input file.
     Example
    root folder to start search
    \\servera\sales
    \\servera\it\salesa\cmmstr.txt
    \\servera\it\salesb\cmmstr.txt
    \\servera\it\salesc\cmmstr.txt
     I need to create a a single cmmstr.txt on the root folder. I would like it to be able to run this with parms to pass in folders to search and file names to search and single file name to create. I'm going to have a least 10 differnt files to
    search for and create output file for. The folders to search
    will somewhat be static.
     Thanks.

    I tested this out on my own seat and I think it should work for you. I wrote it as a function, all you have to do is pass the root folders you want to search and the file your looking for. The function will then search that directory and all sub directories
    for that file name. you will also have to provide it a file to append to, if the file dosen't exists the function will create it. If you run into an issues let me know and the links Mike
    Laughlin posted are a great resource.
    Function Search-Files{
    Param([String[]]$Locations, $SearchFor, $AppendTo)
    Begin
    If(-Not (Test-Path $AppendTo)){New-Item $AppendTo -ItemType File -Force}
    Process
    ForEach($Location in $Locations)
    $Files = Get-ChildItem -Path $Location -Filter $SearchFor -Recurse
    ForEach($File in $Files)
    Get-Content -Path $FIles.FullName | Out-File $AppendTo -Append
    End{}
    Search-Files -Locations "\\Server1\c$\Temp", "\\Server1\c$\Test1" -SearchFor "Install.cmd" -AppendTo "C:\Temp\Search.log"

  • Searching shared computers for files

    I want to search for files over my wireless network. I am connected to my shared computers,I can access files and things. I want to use spotlight to search, but the word "Shared: is not in the "Search: " ,...This Mac"..... bar, like it is on my Mac Book Pro, How do I get it back in there?

    I must have done something, its back

  • Dynamic update to Inbound Directory for File Adapter Read

    I've seen references to others asking similar questions but never a good answer.
    I have a process that outputs files into daily dated directories. In other words, my Inbound Direct name is dynamic. I would like BPEL to be able to pick up these files but the Directory Spec for the inbound file adapter seems to be set at design time (or in the case of a Logical Directory Deployment time).
    The directory names are in YYYMMDD format. So it would be:
    importdir/YYYMMDD
    for each day.
    Is there a way I can monitor an entire subtree, or have some event that triggers the directory name to be updated (for instance, a process watches the parent directory and kicks off when a new directory is created), or any other method I can inform the FileAdapter to begin polling a different directory.
    Thanks.

    Hi,
    Look at this document : [Oracle JCA Adapter for Files/FTP|http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10231/adptr_file.htm#CIAFJCCE]
    Romain.

  • Default directory for FIle Manager

    Hi,
    I am working on file manager for my final year project. I am using jsp, Tomcat and Linux as OS.
    The question is,
    "Is there any way to authenticate users from OS(linux or windows 2000) and how can i set user home directory(e.g. home/sahsan/) to my file manager default directory"
    I really appreciate if anybody help me in this regard. I am ready to read any article,tutorial or even any book chapter for this purpose. Coding Help will be best choice ;-)
    Thank you.
    Regards,
    Syed Ahsan

    I am not sure, i am in search of the code as well. pls let me know if u come across something. i will keep u posted if i know some.........
    Riz

  • File adapter validate file checking directory for files

    Hi Gurus,
    We have requirement. There are 3 directories (Processing, Error and Archive)in the Source side.SAP PI need to pick up a file called "abc.txt" from the processing tab.
    But there is a condition.
    1. If "abc.txt" file exists in the "Error" directory then Not process the interface.
    2. If there is no "abc.txt" file in the "Error" directory then validate the file "abc.txt" in the "Processing" directory. If the file is not according to the validation rule then move the "abc.txt" file to the "Error" directory and then stop the processing.
    3. if the above two conditions are ok then move the "abc.txt" file to "archive" directory and send the file to PI.
    Please help me to achive this requirement.

    Hi Kevin,
    You need to use the option of "advanced selection for source file" in the source tab of  sender comm. channel.
    chk this link :-
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    hope its of some help
    Regards,
    Rohit

  • Default directory for file-upload in web.xml

    Hi,
    Does any one know how to specify a relative path for the temporary directory in the web.xml file.
    In the web.xml file under the jato_MultipartFormFilter filter I tried to change the name of the directory so that it reflects a relative path but it did not work. The deployment process gives the following exception:
    Failure creating test file in directory "tmpDir"; disabling temp file for uploads
    java.io.IOException: No such file or directory
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    When I tried to keep the default setting, i.e. keeping the tag empty. The server gives a permission denied since I am not accessing as the root user as shown next:
    Root cause:
    java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.checkAndCreate(File.java:1314)
    at java.io.File.createTempFile(File.java:1402)
    The only thing I can do is specifying an absulte path from the root directoy '/' in my machine, not the root directory of the application.
    <init-param>
         <param-name>tempFileDirectory</param-name>
         <param-value>/home/Basil/myTemp</param-value>
    </init-param>
    Any help is greatly appreciated,
    Regards,
    Basil mahdi

    Todd and I discussed this last night. We did not seem to have included support for automatic detection of a relative path entry. We have issued an RFE for this. There is little that we can do if the file location cannot be opened due to permission problem. If the java.io.File temp file feature does not work for your web application then I suspect this is an issue in the application server; perhaps a misconfiguration or security policy issue. If you would like to indicate a path relative to context root then we have a workaround for you. Please use the call <ServletContext>.getRealPath("/"); and then append you relative path. This is essentially what we will end up doing when we implement the RFE. regards -matt-

  • Not able to select physicalschema directory for file data server in ODI 11g

    Hi,
    I am a beginner to ODI tech and stuck up with an error while doing a tutorial (mentioned in this link - http://st-curriculum.oracle.com/obe/fmw/odi/odi_11g/ODIproject_ff-to-ff/ODIproject_flatfile-to-flatfile.htm).
    While creating a physical schema for default file server(FILE_GENERIC) , I am not able to select schema directories and the name field with value 'FILE_GENERIC.Directory' is grayed out (non editable)
    I have gone through many documents but could not find any relevant information for this.
    So could you please let me know if any configurations required for this?
    Thanks,
    Anusha

    Hi Oleg,
    Thanks for your reply.
    While creation of physical schema , Name field is grayed out , is that the default behaviour of the screen? because in the tutorial I could see the name filead is pointing to a file directory path.
    Thanks,
    Anusha

  • Network authentication for File object

    I am trying to create a File object from a file on a windows network, but the network share requires a different username and password from the machine that it is running on. Is there a way to pass the username and password when creating the File object to avoid the "Access is denied" error?
    Thanks for the help. If I haven't been clear or I can provide any additional information please let me know.
    Matt

    I am trying to create a File object from a file on a
    windows network, but the network share requires a
    different username and password from the machine that
    it is running on. Is there a way to pass the
    username and password when creating the File object
    to avoid the "Access is denied" error? Not in a pure-Java way, no. The correct fix for this problem is to get the permissions appropriately changed and/or run the app as the appropriate user, so that the user running that Java process already has rights to do that.
    As a stop-gap, you could invoke your Java app from a script, and part of that script could mount the share with the appropriate credentials. For example, in Windows XP, the shell command to do that is:
    net use [sharename] [password] /USER:[user]
    and don't forget to "un-use" it when done. So there would be a corresponding:
    net use [sharename] /delete
    at the end of the script when your app has terminated.
    Refer to your operating system command help.

  • Search event logs for file system access

    I'm looking to create a script that will allow me to search Windows 2012 security event logs for access to specific folders.  Ideally it would allow the granularity to search for read access events (4663) and specify specific users to view.  One
    example would be to show events for drive F:\ where the folder name is JSmith (including subfolders) and the username is not JSmith.
    I've tried something like this, but can't see how to filter.
    Get-EventLog security | ? {$_.Message.contains("F:\JSmith")}

    Is the match explicit?  How can I use wildcard?  How can I exclude events?
    I recommend asking a search engine and doing some initial research. Here's a starter:
    https://technet.microsoft.com/en-us/library/hh849682.aspx
    http://blogs.msdn.com/b/powershell/archive/2009/06/11/windows-event-log-in-powershell-part-ii.aspx
    http://blogs.technet.com/b/ashleymcglone/archive/2013/08/28/powershell-get-winevent-xml-madness-getting-details-from-event-logs.aspx
    http://blogs.technet.com/b/heyscriptingguy/archive/2011/01/24/use-powershell-cmdlet-to-filter-event-log-for-easy-parsing.aspx
    https://richardspowershellblog.wordpress.com/2009/03/08/get-winevent/
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • How do I search a spreadsheet for a list of URL's | then search those URL's for keywords | save the output? (Oh yeah..., and schedule it)

    Fist, I should mention I am not a programmer but am eagerly learning powershell!
    I am looking for an automated solution to accomplish what I am currently doing manually.  I need a script that would combine the following:
    Reach out to a list of websites (probably a loop of some sort since the list will come out of a spreadsheet which could contain 1 or 100 different sites)
    Search each page for a specific word or words (not contained in the spreadsheet though that may make it more scalable)
    Save the URL of the site(s) that contained the keywords to one text file (versus the multiple .html files I am creating today)
    Have the output contain which words it found on which site.
    If not overly complicated, I would like to schedule this to recur once a week.
    A working script would be ideal, but even the resources that show me how to incorporate each element would suffice.
    I have had success pulling down the full content of the listed pages and saving them to a directory, which requires manual intervention.
    So far this works, but it's not scalable:
         Set-ExecutionPolicy RemoteSigned
         $web = New-Object Net.WebClient
         $web.DownloadString("http://sosomesite/54321.com") | Out-File "C:\savestuffhere\54321.html"
         $web.DownloadString("http://sosomesite/54321.com") | Out-File "C:\savestuffhere\65432.html"
         Get-ChildItem -Path "C:\savestuffhere\" -Include *.html -Recurse | Select-String -Pattern "Keyword 1"
    In otherwords, I have to manually replace the "http://sosomesite/54321.com" and "C:\savestuffhere\54321.html" when the URL changes to .\65432.com and the output name to match.  That works fine when it's a couple sites, but again,
    is not scalable.  
    Then, to see if any of the saved file's contain the keyword(s), I have to search the directory for the keyword which I am using:
    Get-ChildItem -Path "C:\savestuffhere\54321.html" -Include *.html -Recurse | Select-String -Pattern "Keyword 1"

    Hi Sure-man,
    Sorry for the delay reply.
    To automatically Reach out to all urls, you can list all urls in a txt file "d:\urls.txt" like this:
    http://sosomesite/54321.com
    http://sosomesite/65432.com
    Then please try the script below to save the URL of the site(s) that contained the keywords to one text file "d:\outputurls.txt":
    $urls = get-content d:\urls.txt
    foreach($url in $urls){
    $results = $web.DownloadString("$url")
    $matches = $results | Select-String -Pattern "keyword1","keyword2"
    #Extract the text of the messages, which are contained in segments that look like keyword1 or keyword2.
    if ($matches.Matches){
    $Object = New-Object PSObject
    $Object | add-member Noteproperty keyword $matches.Matches.value
    $Object | add-member Noteproperty URL $url
    $output+=$Object}
    $output|Out-File d:\outputurls.txt
    If you want to schduled this script in Task Scheduler once a week, please save the script above as .ps1 file, and follow this article:
    Weekend Scripter: Use the Windows Task Scheduler to Run a Windows PowerShell Script
    If I have any misunderstanding, please let me know.
    I hope this helps.

  • Search & Replace function in Files?

    Does there exist a "Search & Replace String" function for Files IO? ...preferable RandomAccessFile.
    Or do I have to make my own parser from scratch.
    Anyone know of free code that exists somewhere? This seems like a function that someone must have made at least or has a use for.
    Thanks for any! :)
    rasmasyean

    The JDeveloper Editor provides Search & Replace functionality for files.
    What I typically do is
    Select menu: Search | Search Source Path...
    Enter Search String and Change Source path
    and other fields and press Start
    Then the Navigator displays a Search tab which lists all files with the matching string.
    Double click on first file in navigator and
    select menu Search | Replace
    In this dialog enter your search, replace, and other options-
    In the Options, If you do not want to be prompted, do not check the Prompt on replace option.
    Select the Scope of Global
    Selectg the Origin of Entire
    When you are ready press the Multiple button to make multiple replacements.
    When you are done with this file,
    Press Ctrl-S to Save the file
    Press Ctrl-F4 to close the window
    Double click on the Next File
    Press Ctrl-R to invoke the Search | Replace dialog.
    You should not need to change any options.
    Press Alt-M to select the Multiple Button!
    While this may seem more complex then a simple Sed / Perl / Python script, it is more controllable, flexible and user friendly.
    Besides, you may learn a few JDeveloper tricks.
    Good Luck,
    -John

  • I am running Mac OSx Lion 10.7.2. My problem is I can't search on an external network server for a file with the finder toolbar anymore. Nothing shows up and it will not search. I was able to in snow-leopard and am no longer able to w. Lion. Suggestions?

    I am running Mac OSx Lion 10.7.2.
    My issue is that I am not able to run a search in the finder toolabar on a network server. No files show up nor does it search on the server anymore. I was able to run the search in snow-leopard and am no longer able to do so with Lion. Is there a preference I can change or some kind of app or program I can download that will help me with this issue? This is extremely problematic for me as I am searching for files all day everyday. Thank you!

    Hello,
    It isn't the fw in Network you want o use or look at, that's for something completely different.
    My first suspect is the Power Adapter on the LaCie has gone.
    At the Apple Icon at top left>About this Mac, then click on More Info, then click on Hardware>Firewire, what is listed there?
    Reset the Firewire bus
    If your Firewire or USB isn't recognizing any device.  A solution which has worked for some whose hard drive became invisible in 10.4 was simply to follow these four steps to reset the Firewire/USB bus:
    1. Shut the machine down.
    2. UNPLUG the power lead to the computer and any firewire/USB drive or devices.
    3. leave it for 10 minutes.
    4. Connect back up and reboot.
    http://www.macmaps.com/firewirebug2.html

Maybe you are looking for

  • Itunes can't run bc of audio configuration problem

    Well I've been using itunes for about 2 years now and just recently i installed the newer version. It was working fine until today when my computer told me ther was some kind of computer error and that i should do a system restore. So i did a restore

  • Issue check to customer

    Hi Gurus, I have a business scenario: Customer comes to store and picks up the items and pay the item.  I use F.13 to clear customer open items. When customer comes for exchange, customer returns item and pick ups another item i receive return sales

  • How do I know what model Power Supply to buy?

    I have a 2007 Mac Pro 3Ghz and I was wondering if the power supply I need is just the one for this year or is it determined by something else like my model number or what. I have really only seen one out there for just like 2006-2007 Mac Pro but ther

  • Unable to save workflow types and create workflow stage  in CUP

    Hi Guru's, We are currently installling GRC AC 5.3 and are stuck in configuration. we are unable to create workflow stage in CUP. Whenever we try to open the tab for stage it gives below mentioned error. Webpage error details Message: Expected ';' Li

  • Lenovo Solution Center Hardwarescan meldet Drahtlos Problem beim lokalen Verbindungstest

    Hallo, nach einem Hardwarescan meldet Lenovo Solution Center ein Problem unter der Rubrik "Drahtlos". Offensichtlich besteht ein Problem beim lokalen Verbindungstest. Der Ergebniscode lautet "WWF00F000-UJ7Y2E". Habe bisher keine Probleme mit der Netz