Results 1 to 8 of 8

Thread: ftp (nothing to do with vb!)

  1. #1

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    using the command line ftp
    if I do a get on a file which ends in a . the final . gets dropped

    why?

    how can I retain it?
    Mark
    -------------------

  2. #2
    Guest
    Did you enclose it in "'s?
    get "myfile."

  3. #3

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Yep! Tried that!


    Mark
    -------------------

  4. #4
    Guest
    Hmm looks like windows doesnt want a file to end with a period, when i try to create or rename a file to end with a period it always drops the ending period, 'test.' becomes 'test'.

    This probbably applies to all windows versions:

    Q115827 - INFO: Filenames Ending with Space or Period Not Supported

    INFO: Filenames Ending with Space or Period Not Supported

    --------------------------------------------------------------------------------
    The information in this article applies to:

    Microsoft Win32 Application Programming Interface (API), used with:
    Microsoft Windows NT Server versions 3.5, 3.51
    Microsoft Windows NT Workstation versions 3.5, 3.51
    Microsoft Windows 95

    --------------------------------------------------------------------------------
    CreateFile() removes trailing spaces and periods from file and directory names. This is done for compatibility with the FAT and HPFS file systems.

    Problems can arise when a Macintosh client creates a file on a Windows NT server. The code to remove trailing spaces and periods is not carried out and the Macintosh user gets the correctly punctuated filename. The Win32 APIs FindFirstFile() and FindNextFile() return a filename that ends in a space or in a period; however, there is no way to create or open the file using the Win32 API.

    Applications such as File Manager and Backup check to see whether the filename ends with a space or period. If the filename does end in a space or a period, then File Manager and Backup use the alternative name found in WIN32_FIND_DATA.cAlternateFileName to create and open the file. Therefore, the full filename is lost.

  5. #5

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Thanks for finding that for me Azzmodan!


    in case you are wondering why it mattered here's what I was doing:

    I've got a batch file which logs into UNIX box via ftp and gets all the files in a particular directory, logs off, list and moves the files and then deletes them next time it connects.

    Now, some of the files end in . so the del command was failing and it said file not found because the . had been removed.

    If I could do a destructive GET like would be so much easier...

    We've now changed the system on the UNIX box to ensure that files never end in .

    Here's the .bat files I wrote for this:

    getfiles.bat
    Code:
    if not exist c:\frt\testlist.txt goto firstpass
    
    :here
    
    cd c:\public\faxes
    ftp -n -i -s:c:\frt\testlist.txt [IP ADDRESS]
    
    del c:\frt\testlist.txt
    
    echo user [USERNAME] [PASSWORD] > c:\frt\testlist.txt
    echo cd [REMOTE PATH] >> c:\frt\testlist.txt
    
    for %%f in (*.*) do call c:\frt\createList.bat %%f
    
    echo mget * >> c:\frt\testlist.txt
    
    rem waiting...
    c:\frt\sleep 60
    
    goto here
    
    :firstpass
    rem create the file 
    echo user [USERNAME] [PASSWORD] > c:\frt\testlist.txt
    echo cd [REMOTE PATH] >> c:\frt\testlist.txt
    echo mget * >> c:\frt\testlist.txt
    
    goto here
    createList.bat
    Code:
    echo del %1 >> c:\frt\testlist.txt
    
    move c:\public\faxes\%1 C:\Inetpub\ftproot\frt\fax\%1
    here sleep() is a small app just to delay execution
    Mark
    -------------------

  6. #6
    Member Red Thread's Avatar
    Join Date
    Aug 2000
    Location
    Europe-Belgium
    Posts
    44

    How to start ?

    hi there,

    since i must design a program that just do the thing you are discribing (log in to unix, download the drawingfiles and copy them on a local harddisk...) i'm just wondering i've you could give me a good example in code on how to start.

    I'm a newby if it goes into ftp,unix and that stuff. So an example in code as you are describing would be very appriciated...

    If you don't want to share the code, i also appriciad that descission.

    You always can contact me at

    [email protected]

    thx in advance

  7. #7

    Thread Starter
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Mark
    -------------------

  8. #8
    Member Red Thread's Avatar
    Join Date
    Aug 2000
    Location
    Europe-Belgium
    Posts
    44

    thx

    thx mark...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width