Java.io.File only returns similar file names

I have written a bean which reads a directory and places the file names in an array, which can be accessed by a JSP page. At first, the files inside the directory were named wb_1.jsp, wb_2.jsp, wb_3.jsp and so on. When I change a filename to something like work.jsp, it still appears in the file list, but when I rename it to something like identify.jsp, it doesn't!
If I count the array, it does read the correct number of files.
Class FileHandler
// Imports
import java.io.File;
// Class
public class FileHandler
     // Constants and variables
     public File dir;
     public File[] files;
      * Returns the number of files found inside the given directory
     public int showFiles()
          try
               setDir(getDir());     // Get file directory as set in the bean property
               files = dir.listFiles();     // List the files found inside the directory
          catch (Exception e)
               System.out.println(e + " : No files found to return a value");
          return files.length;      // Return the number of files
      * Returns the file name by using the in value in the files array
     public String returnFileName(int in)
          return files[in].getName();     // Return the name of the file
      * Sets dir file type to the setproperty value in
     public void setDir(File in)
          dir = in;     // Set class variable value for dir
      * Returns the dir value
     public File getDir()
          return dir;     // Return the setproperty value for dir
}And the JSP code which reads the array
out.println("<select onChange=\"jumpMenu('top',this,0)\" size=\"5\" style=\"width: 200\"");
String fileName = new String();
for(int x=0; x<file.showFiles(); x++)
     fileName = file.returnFileName(x);
     out.println("<option selected value=\"beheer.jsp?action=2&file=" +  fileName + "\">" +  fileName +"</option>");
out.println("</select>");

I forgot bean properties im the above code lines. Here it is, just in case.
<jsp:useBean id="file" class="FileHandler" scope="page" />
<jsp:setProperty name="file" property="dir" value="C:\\IBM Websphere workspace\\Project\\Web Content\\WEB-INF\\include" />

Similar Messages

  • How can I search a file system and only return newer files?

    Sorry the title didn't give me much room to work with. I'm writing a tool which needs to track all the files in an OS. What I'd like to do is make it so my program will only return files that have been modified/created since the last search to add to my program. I was wondering if there's an efficient way to do this other than checking each file's timestamps? Also is there a way to tell from a parent directory whether any files in its directory have been modified/created? I'm looking for ways for Windows and Linux.

    I have no problem checking timestamps but it can be rather time consuming doing this. I don't know if this is quicker but I'd like to sort by modified date and check the time stamps for newer timestamps than the last time I ran. This way if I hit a time stamp equal to my last run I know to stop there. I checked Windows and the folder does tell you whether any file was created/modified in it's directory. However, if a file is created in one of its children's directories it won't update the time stamp. It's unfortunate because I could've avoided the search at a higher level directory otherwise. Without this I'll have to walk the whole structure one way or another. I can still improve the speed but I can't make it as efficient as I'd like.

  • CCP for Mac downloads pkg files only (Windows msi files missing)

    I'm a Mac user and would like to generate a CCP package for a Windows users group to install Adobe Premiere on their desktops but CCP seems to only be downloading pkg files and excluding msi files.
    Any help or information will be appreciated
    Thanks
    ND

    There's a separate packager app that runs on Windows you'll need if you're going to be building Windows packages.

  • How come Java methods can only return one variable?

    Hi,
    I am just curious, how come C/C++/Java methods/functions can only return one argument but can accept many parameters.
    I know that the workaround is to return an object, but sometimes creating a class is just too much overhead.
    Thank you in advance.

    Hello,
    It's an interesting discussion. To get the full answer to your question, you'd have to consult the library and find books on programming language design and implementation.
    I believe the tradition goes all the way back to the first programming languages having subroutines/procedures/functions/methods in them: you can return nothing at all (void i Java) or a single value. The need for returning a single value, I guess, comes from the wish to embed calls in arithmetic expressions:
      res = 2 * someObject.foo(x) - anotherObj.bar(a,b);To my knowledge, few languages allow you to return more values. One that does is BETA (see www.daimi.au.dk/~beta/). Though not indispensable, it's convenient sometimes. I don't know why it's not more widespread.
    Yours,
    Ole

  • Pressed 'Install Lion' on existing copy of lion and the new Lion Installation started. I have cancelled it. Now, will it reformat (and so remove) all the files or will it replace the lion files only, leaving my files alone if I continue?

    Hi
    I wanted to reinstall the existing copy of lion on my Macbook Pro, leaving my files alone. So I started the Lion Installation and I thought that after the mac reboots, the window will pop-out asking what I want to do. It didn't however and it started new lion installation after which I immediately aborted it. My question is: Will my files stay untouched if I carry on installing?
    Thanks for the answers in advance.

    The Lion installer won't ask you if you want to repair. If you boot into the Recovery HD you can then select to reinstall Lion, which willl reinstall the Lion files but leave your Home folder alone. If you want a clean install, then from the Recovery you can open Disk Utility to wipe the Lion partition and then use the transfer function to retrieve your data from your Time Machine backup.

  • Dir command returns wrong file names.

    The dir command appears to be returning a file name that is incorrect. I execute the following command and get the shown output:
    D:>dir Ind*
     Volume in drive D is Data Disk 1
     Volume Serial Number is ****-****
     Directory of D:\Users\<username>\Documents\Personal\Financial\Fidelity
    12/24/2013  01:26 PM            81,597 Investment Report 2013-04.pdf
    10/04/2007  10:35 AM            59,763 Individual 2006-12.pdf
    04/20/2007  07:44 PM            63,284 Individual 2007-02.pdf
    04/20/2007  07:43 PM            63,658 Individual 2007-03.pdf
    10/04/2007  10:41 AM            64,591 Individual 2007-04.pdf
    10/04/2007  10:42 AM            66,608 Individual 2007-06.pdf
    [snip]
    02/12/2012  11:47 PM            78,289 Individual 2011-10.pdf
    02/12/2012  11:47 PM            70,901 Individual 2011-11.pdf
    02/12/2012  11:48 PM            78,773 Individual 2011-12.pdf
                  60 File(s)      4,327,003 bytes
                   0 Dir(s)  381,563,613,184 bytes free
    Tried searching the forum but didn't find this. Is this a known issue?
    John

    Without some care, it seems that that can cause some very unexpected results in batch files if you use wildcards to process files.
    This is correct. You can suppress the generation of 8.3 file names with this command
    fsutil behavior set disable8dot3 1
    or check what the parameters mean like so:
    fsutil behavior set disable8dot3 /?
    The command will affect newly created files only. Existing files will retain their 8.3 names unless you remove them with this command:
    fsutil  8dot3name  strip  FolderName
    Your file retained its unexpected 8.3 name most likely from an early name that started with "ind".

  • How do you write a class to return a file?

    So I've read http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html
    But I still do not know how to pass a file to a calling method of another class. How does the FileChooser class retrun the file. Please help.

    You mean something like this?
    import java.io.File;
    public class FileTest {
         public File getFile(String path) {
         //Example path =  "C:\\path\\to\\file.txt"
              return new File(path);
    }

  • During Upgrade - Keep Personal Files Only? or Nothing?

    The help file for Windows 8 Setup says the keep personal files only will keep files under
    \\user\ folder what will happen to folders in the root folder of C:\?.
    Personal files.
    Anything saved in the User folder is considered a personal file, like the Documents and Desktop folders.
    What does it do with the other folders? (Leave, Delete or move to windows.old?)
    If nothing is your choose does this move Root drive files to windows.old?
    Nothing.
    Delete everything and replace your current version with a copy of Windows 8. Your personal files will be moved to a windows.old folder.
    What does it do with the other folders? (Leave, Delete or move to windows.old?)
    Vote for Freedom - Vote to Protect our Country

    Hi,
    Please see “How do I upgrade from Windows 8 Consumer Preview (CP) or Windows 8 Release Preview (RP) to the Released-to-Manufacturing (RTM) version of Windows 8?” in the following thread:
    Windows 8 FAQ
    http://social.technet.microsoft.com/Forums/en-US/w8itprogeneral/thread/7d76e468-192e-4672-8f8e-e78d1446dfaa
    Hope this helps.
    Thanks.
    Nicholas Li
    TechNet Community Support

  • How to moidfy ant file to compile page flow files only

    Hello,
    Our existing application is compiled with standard ANT task and running on weblogic server. Now I try to change the jsp part using page flow and weblogic workshop.
    I think I still need to create an application and a project that contains the page flow files. How can I modify the the ANT file and compile the page flow files only, then these files can be packed with other files into a WAR file?
    Thank you for the help in advance.
    Zhong

    Hi,
    You can go through this weblog Handling Of Non-HTML Documents by Brian. It would be useful to you.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    Regards,
    Ravikiran.C

  • Returning full DNS name

    I'm writing a program that pings couple of computers from the list and returns some relevant information like IP Address and DNS, but I can't seem to get it to return full DNS name. I'm using InetAddress class to get this done and here is the code I'm using:
    try
                   InetAddress inet = InetAddress.getByName(hostName);
                   boolean status = inet.isReachable(5000);
                   if (status)
                        System.out.println(inet.getCanonicalHostName() + " Host Reached");
                   else
                        System.out.println(inet.getCanonicalHostName() + " Host Unreachable");
              catch (UnknownHostException e)
                System.err.println("Host does not exists");
            catch (IOException e)
                System.err.println("Error in reaching the Host");
            }This only returns full DNS names on computers that have trusted connection but I need it to return it for all of the computers. I have same program written in C# and I was able to do it easily. I just can't seem to figure it out in Java. If anyone has any suggestions that would be great, thanks.

    Hi Rainer,
    if you have a naming convention, which includes parts of the ftp server name into the name of the communication channel, you could try the search in Integration Directory (config).
    Regards
    Sven

  • Linking to exported files from .exe project file

    Hi,
    I've read several posts regarding this issue, and it doesn't seem as though anyone has come up with a solution, but I thought that I re-energize the discussion.
    I have a pretty large project and have encountered many problems while trying to compile it with Captivate.  I've finally streamlined the project by creating mini swfs and inserting them as an animation on various slides within the overall project file and have been able to get the entire project to play in the preview modes pretty smoothly (with some minor issues that I'll save for another post).  All links and buttons have remained in tact, and we are now experiencing very little sluggishness.  I had hoped to package this project on a CD for beta-testing today.  However, when I attempted to publish what I was hoping to be the final project file this afternoon and selected the .exe option, none of the linked items (swfs, pdfs) launched when tested.
    Now, during the publishing process, I do  receive the following message:
    The file / projects linked below are linked to the open project.  The linked files / project may require exporting.
    It is also important to copy all referenced files and projects with their corresponding html files to the output folder.
    Ok, "may require exporting" to where?  All of the linked files are located in the same folder as the .exe file (pdfs, swfs, htms, etc.).  What output folder is the message above referencing?  I made sure that I didn't place any of these files with the exception of the pdfs into a separate folder so that they would be easily accessed.  My back is truly against the wall here since I've been troubleshooting a host of issues with this application for weeks now and this project is supposed to be ready for prime time.  Since Adobe doesn't support Authorware anymore and has been pushing this app down our throats the ability to obtain support and / or solutions to these types of problems does not meet the needs of the user.  Does anyone have a solution which does not include the Aggregator?

    Hi there
    I believe I may be the one that assisted with the files.
    I'd like to address some comments if I may.
    MMCwebs wrote:
     ... I did receive some assistance from one of the gurus who created swf files for each pdf which assisted me in resolving the problem for that particular project,
    however, those files only open the file names that were programmed into
    the swf.  I was never able to get him to provide me with the original
    file to edit as needed...
    The way I do these is by using a companion application that shipped with Captivate 2 and 3 called "MenuBuilder". There was no overt and secretive reason for not providing the source. The real reason behind it was that I was creating these on my end because the recipient didn't have MenuBuilder. Therefore the source files would be as useful as a buggy whip for making the car run faster. I'd have been more than happy to provide source files as long as they would be useful to someone.
    If you have MenuBuilder on your own machine, it's quite simple to create the files. I've documented the steps needed on many occasions here in the forums.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Aperture skipping import of similar file names?

    I discovered this this other day and raised the question in a "top 10 Aperture Suggestions" post. I've done more investigating since then without coming up with a solution. So I'm going to post it as it's own question here.
    Up to now my workflow has included aquiring images from either a negative scanner (which creates a TIFF), or a Nikon D100 digital camera (which creates an NEF). From there I open up the original in Photoshop, make any manipulations I need to and save the new file as a psd in the SAME folder as the original. I can easily keep track of images I have manipulated because I can see the psd right next to the original TIFF or NEF.
    I end up with images called something like photo01.TIFF and photo01.psd. They are completely different files, the TIFF being the original and the psd being the cleaned up, manipulated version - both in the same folder.
    Here's the problem. Aperture doesn't recognize that there are two different files there. Perhaps because the file names before the extension are the same, it ignores the second one during the import process.
    During my latest experiment I took an original TIFF scan of a negative called 129_20.TIFF, opened it in photoshop, did some color correction, and saved it back to the same folder, calling it 129_20.psd. I also created a smaller websized jpg of the same image and called it 129_20.jpg. Now even though there are three files in the folder with admittedly similar file names, anyone would be able to tell that they are actually different files, the original TIFF, the modified psd, and the jpg for the web.
    When I try to import those images into Aperture using either the Import>Folders into a Project command, or the Import>Images command, Aperture only sees the original TIFF and only imports that TIFF instead of the three that are in the folder. If I take the TIFF out of the folder and try again, now Aperture sees the jpg file and I can import that, but not the psd. If I take both the TIFF and the jpg out of the folder and try again, of course only now does it see the psd.
    Once the images are imported into Aperture, I notice that file name extensions are not visible under the images, so unless I click on one and use the Info window or ToolTips to show the meta data, I cannot easily see which version of the image I'm looking at in Aperture because it doesn't display the .TIFF, .psd, or .jpg extensions.
    This is troubling to me and I hope I've simply not come across some setting somewhere that will help Aperture "see" my different versions of the same image. There doesn't seem to be anything on the boards or the Aperture manual directly about this. I've stopped importing because after 14,000 images, I've realized I'm "missing" all of my Photoshop corrected ones. Before I continue importing, I'd like to figure out if there is a work-around, if it's operator error, or if Aperture doesn't can't tell the difference between similar files names with different extentions.
    Sorry about the length of this, but I'm trying to be thorough.
    G5 Dual 2GB   Mac OS X (10.4.3)   2GB RAM
    G5 Dual 2GB   Mac OS X (10.4.3)   2GB RAM

    Yes I discovered exactly the same thing whilst trying to overcome another problem - that aperture lost metadata on tiffs saved with IBM PC bytes rather than Mac bytes ( in this case out of house scans done on a PC ). I tried saving my files as tiff Mac, psd and jpg in the same folder but with the same name apart from the extension. As you say Aperture only sees them as one file ( although it adds up their combined file size according to the image information dialogue box window ). On import it only imports one file. If you use the 'Import Folders into a project' option from the file menu it sees the three files in the navigation section OK but again only imports one. I then experimented with doing major changes in image size and adjustments and of course that made no difference.
    I did find that I could import the files individually by dragging them one by one into a project but of course that is no help if you have thousands to import.
    After some thought I decided that perhaps that was in tune with the idea behind Aperture being that you have only one master file which you then repurpose and export as required. My conclusion about Aperture at the moment is that it would be great if we were all starting from scratch but that it is struggling to cope with the admittedly enormous task of dealing with photographers who have massive libraries of existing images created, processed, keyworded and stored in all sorts of programs. Clearly we all need access to these and the info they contain as well as dealing with our future work.
    Sorry not to be more help.
    Best wishes
    Jonathan
    Imac G5/ Dual 2 Ghz Power PC G5   Mac OS X (10.4.3)  

  • Script to rename files that have similar names?

    Hi, folks.
    I have my  RAW files in one folder and my derivative images (e.g., PSDs, TIFFs,  JPEGs) in another.  The derivative files only share the last four digits  of the RAW file names (e.g., the RAW file is named 100826-14278.CR2 but  the JPEG version is only named 4278.JPG).  Also, the derivative files  have no metadata.
    Is there a way to use a script to match all the  derivatives to the RAW files based on the last four digits, then change their file names  to match the RAW names.  And, if that's possible, can Bridge then  cascade the metadata minus the camera data EXIF from the RAW files to  the derivative files?
    Thanks!
    -Greg
    P.S. My knowledge of scripting stops with cursive handwriting, so please be gentle.

    Thanks the coffee was great!
    Here is a new version with subfolder support. Just select the folders as normal and it will search derivitive subfolders.
    #target bridge  
    if( BridgeTalk.appName == "bridge" ) { 
    var newMenuData = new MenuElement( "menu", "Add_Metadata", "after Help", "myMetaData" );
    var newDataCommand = new MenuElement( "command", "Rename and Add Metadata", "at the end of myMetaData" , "zxcv" );
    newDataCommand.onSelect = function () {
       renamePutXMP();
    function renamePutXMP(){
    var win = new Window('dialog','Rename and Add Metadata');
    g = win.graphics;
    var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.99, 0.99, 0.99, 1]);
    g.backgroundColor = myBrush;
    win.alignChildren="row";
    win.g10 = win.add('group');
    win.g10.orientation = "row";
    win.title = win.g10.add('statictext',undefined,'Rename / Add Metadata');
    win.title.helpTip="Compliments of Paul";
    win.title.alignment="bottom";
    var g = win.title.graphics;
    g.font = ScriptUI.newFont("Georgia","BOLDITALIC",22);
    win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"});
    win.p1.alignChildren="fill";
    win.g5 =win.p1.add('group');
    win.g5.spacing=10;
    win.g5.st1 = win.g5.add('statictext',undefined,'Raw Files');
    win.g5.st1.preferredSize=[100,20];
    win.g5.et1 = win.g5.add('edittext');
    win.g5.et1.preferredSize=[250,20];
    win.g5.et1.enabled=false;
    win.g5.bu1 = win.g5.add('button',undefined,'Browse');
    win.g10 =win.p1.add('group');
    win.g10.spacing=10;
    win.g10.st1 = win.g10.add('statictext',undefined,'Derivative Images');
    win.g10.st1.preferredSize=[100,20];
    win.g10.et1 = win.g10.add('edittext');
    win.g10.et1.preferredSize=[250,20];
    win.g10.et1.enabled=false;
    win.g10.bu1 = win.g10.add('button',undefined,'Browse');
    win.g15 =win.p1.add('group');
    win.g15.orientation='row';
    win.g15.alignment="top";
    win.g15.spacing=10;
    win.g15.bu1 = win.g15.add('button',undefined,'Process');
    win.g15.bu1.preferredSize=[200,30];
    win.g15.bu2 = win.g15.add('button',undefined,'Cancel');
    win.g15.bu2.preferredSize=[200,30];
    win.g5.bu1.onClick=function(){
         rawFolder = Folder.selectDialog("Please select the raw files folder",app.document.presentationPath);
         if(rawFolder !=null){
      win.g5.et1.text =  decodeURI(rawFolder.fsName);
    win.g10.bu1.onClick=function(){
         derivativeFolder = Folder.selectDialog("Please select the derivative files folder",app.document.presentationPath);
         if(derivativeFolder !=null){
      win.g10.et1.text =  decodeURI(derivativeFolder.fsName);
    win.g15.bu1.onClick=function(){
        if(win.g5.et1.text == ''){
            alert("No Raw folder selected!");
            return;
        if(win.g10.et1.text == ''){
            alert("No Derivative folder selected!");
            return;
        win.close(1);
        process(rawFolder,derivativeFolder);
    win.center();
    win.show();
    function process(rawFolder,derivativeFolder){
    var rawFiles = rawFolder.getFiles (/\.(cr2|crw|tif|jpg)$/i);
    if(!rawFiles.length){alert("There are no raw files to be processed!"); return;}
    var derivativeFiles=derivativeFolder.getFiles (/\.(jpg|tif|psd)$/i);
    if(!derivativeFiles.length){alert("There are no derivative files to be processed!"); return;}
    var folderList=[];
    getFolders(derivativeFolder);
    folderList.unshift (derivativeFolder);
    derivativeFiles=[];
    for (var a in rawFiles){
    var Name = decodeURI(rawFiles[a].name).replace(/\.[^\.]+$/, '');
    var fileMask = Name.match(/\d\d\d\d$/)+"*.*";
    var destFiles=[];
    for(var z in folderList){
    var destF = folderList[z].getFiles(fileMask);
    for(var s in destF){destFiles.push(destF[s])}
    for(var z in destFiles){
    var Ext = decodeURI(destFiles[z].name).replace(/^.*\./,'');
    var destName = decodeURI(destFiles[z].name).replace(/\.[^\.]+$/, '');
    destName.substring(4)
       destFiles[z].rename(Name+destName.substring(4)+"."+Ext);
    function getFolders(folder) {
        var fileList = folder.getFiles();
         for (var i = 0; i < fileList.length; i++) {
            var file = fileList[i];
    if (file instanceof Folder) {
    folderList.push(file); 
            getFolders(file);
    $.sleep(300);
    for (var a in rawFiles){
    var Name = decodeURI(rawFiles[a].name).replace(/\.[^\.]+$/, '');
    fileMask = Name + "*.*";
    var destFiles=[];
    for(var z in folderList){
    var destF = folderList[z].getFiles(fileMask);
    for(var s in destF){destFiles.push(destF[s])}
    for(var z in destFiles){
        if(decodeURI(destFiles[z].name).match(/thm$/i)) continue;
    updateMetaData(rawFiles[a],destFiles[z])
    function updateMetaData(sourceFile,destFile){
    if (ExternalObject.AdobeXMPScript == undefined)  ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
    sourceFile = new Thumbnail(File(sourceFile));
    destFile = new Thumbnail(File(destFile));
    var md = sourceFile.synchronousMetadata;
    var source = new XMPMeta( md.serialize() );
    var md2 = destFile.synchronousMetadata;
    var dest = new XMPMeta( md2.serialize() );
    try{
    copySchema( source, dest,XMPConst.NS_CAMERA_RAW,["RawFileName"]); 
    copySchema( source, dest,XMPConst.NS_EXIF,["PixelXDimension","PixelYDimension","ExposureTime","FNumber"]);
    copySchema( source, dest,XMPConst.NS_DC,[]);
    copySchema( source, dest,XMPConst.NS_XMP_RIGHTS,[]);
    copySchema( source, dest,XMPConst.NS_IPTC_CORE,[]);
    var updatedPacket = dest.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
    destFile.metadata = new Metadata(updatedPacket);
    app.document.refresh();
    }catch(e){alert(e+" "+e.line);}
    function copySchema( source, dest, namespace, omitProps ) { 
    var propIter = source.iterator(XMPConst.ITERATOR_JUST_CHILDREN | XMPConst.ITERATOR_JUST_LEAF_NAME, namespace, "" );
    var prop = propIter.next();
    var prefix = XMPMeta.getNamespacePrefix( namespace );
    while(prop) {     
      var name = prop.path.substring( prefix.length );    
       if(omitProps != undefined) var copy = !contains( omitProps, name);
      if( copy ) {
                try{
       XMPUtils.duplicateSubtree( source, dest, namespace, prop.path,namespace, prop.path, 0 );       
                }catch(e){}
      prop = propIter.next();
    function contains( arr, member ){
    var r = false;
    for( var i = 0; i < arr.length &! r; ++i  ) {
      r = arr[i] == member;
    return r;

  • GZipStream Decompression only returns small portion of original file

    I've been trying to use GZipStream to decompress a file originally created with gzip (default settings).  The gzipped file inflates to one file of 5,120,001 KB (~5GB) using gzip -d.  There are no errors and the inflated file matches the original
    byte-for-byte.
    Using the GZipStream to inflate the file with the exact code from Microsoft's example for .NET 4.5 (the Decompress() method) produces a file with roughly the first 500 MB of the original input file.
    I've found some evidence online that others have encountered this problem before and Microsoft says it's been fixed in the latest version of .NET but, using VS 2013 Premium with Update 4 and .NET 4.5.2, I still can't recover my file.  No error, the
    .CopyTo() method just returns.  The code does work for smaller gzip files (~2KB).
    Is this really working for files larger than 4GB?  If so, what do I need to do, please?  If not, well, ditto.
    Happy Holidays to all and thanks for any help.

    Dear Fred,
    Thank you for your response.  The compressed file comes from a UNIX server that used gzip to deflate a large (5GB) text file.  Let's call the original file LARGE.TXT and the deflated file LARGE.TXT.GZ (the names are immaterial but help exposition). 
    LARGE.TXT is 5,120,001 KB and LARGE.TXT.GX is 479,502 KB.  Gzip and WinZip have no difficulty inflating the deflated file and the result is LARGE.TXT in both cases.
    The code is straightforward.  betterName is just a more descriptive name for the output file (fileToDecomress.Name if some great, long, system generated name from the original Unix server).
    public static void Decompress(FileInfo fileToDecompress, string betterName)
    using (FileStream originalFileStream = fileToDecompress.OpenRead())
    string newFileName = betterName.Remove(betterName.Length - 3);
    using (FileStream decompressedFileStream = File.Create(newFileName))
    /* (1) */ using (GZipStream decompressionStream = new GZipStream(originalFileStream, CompressionMode.Decompress))
    decompressionStream.CopyTo(decompressedFileStream);
    Running this produces a file, call it LARGEfragment.TXT, that is roughly 512MB or the first ~10% of LARGE.TXT.  That is, ~90% of LARGE.TXT is missing in LARGEfragment.TXT but the text that is present, is correct.
    Smaller gzipped files (that inflate to ~1GB), say SMALL.TXT.GZ, from the same server are inflated by the above code to SMALL.TXT exactly as expected.  Files of about 2K also work fine.  Thus, it seems the class works properly except for large files. 
    I have about 10TB of these large files to inflate and work with - almost all are 5+ GB when inflated (the server splits logs into 5GB chunks, gzips them, then archives them).  None of the large files I've tried work - all of the smaller ones I've
    tried do work.
    I tried replacing /* (1) */ in the above code with the DeflateStream class:
    /* (2) */ using (DeflateStream decompressionStream = new DeflateStream(originalFileStream, CompressionMode.Decompress))
    This produced a "Block type not recognized" error.
    It's strange.  GZipStream is based on zlib now and so is the Unix gzip.  zlib can work with arbitrary file sizes (up to 16 exabytes, I believe) as long as the "long" type on the system used to compile zlib is 64 bits.  If "long"
    is only 32 bits, file size is limited to 4GB.  Might this have anything to do with it?
    Please let me know if you need more information.
    Thanks again and Happy Holidays!

  • Saving documents with similar file names

    When saving documents with similar file names, I used to be able to hit save as button and go to the file folder I wish to use. I could then click an existing file in the folder to draw in the name and then just modify it slightly to create the new name.
    In Reader DC I get an error saying this is a read only file an can not be saved.  I can save the file if I use a different file name but then I have to go in and rename the file. i.e. if I have a weakly report that I save, I may have the file name "Installerspayroll.we.04.25.15.pdf."
    I used to be able to click on the existing file name to bring it into the name box and then just change the date. The updated version is not allowing me to do that, creating more work.

    I thought you were referring to an admin account within the Adobe program. I am an admin on the machine I am signed into and using while having these problems
    Thank you for this opportunity to share our expertise,
    Michael Mallary
    Treasurer
    Mallary Carpet & Flooring, Inc.
    410-766-6992
    www.mallarycarpet.com<http://www.mallarycarpet.com>
    Earning your unsolicited referrals
    is our number one priority

Maybe you are looking for

  • Need to make links unclickable in a PDF

    The company I currently work for is looking for a solution to a PDF issue.  Currently I know anything that looks like a link becomes a link when you open it with Adobe Reader or Standard/Pro.  I know there is an option per user to turn this feature o

  • Problem in compiling webutil.pll

    Hello!!! I have downloaded and installed webutil 1.0.6. form OTN in a Windows XP in path ORACLE_HOME\forms\webutil. Following the instructions of configuring the webutil I have to compile the webutil.pll , otherwise i get the ORA-06508 message error!

  • Macbook pro is very slow

    My Macbook pro is very slow these days especially the browsers. The system takes more than 2 minutes to start up. why? Sometimes it hangs.

  • Problem after installing 10.4.8 update

    I downloaded the new football manager demo. But I can't play it on my mac. I get this message when trying "array out of bounds" and the game ends I am a new Mac-user and have no idea what to do to solve this problem

  • Macbook pro and airdrop

    I have a Macbook pro and I had airdrop but dont know what happened to it. I clicked it and draged to my desktop and it showed a cloud and disappeared. How do I get it back??