Re: filtype() Problems



Hi Jeff,

Thanks for the help. For now I have found a work around. For some reason this is only effecting some of the files and not any directories. So, instead of using filetyp()=='file' it dawned on me to use !='dir'. That seems to work fine for my needs.

But you're right about error messaging, as you can tell I'm still new at this so I will have to investigate turning this on today.

With that said, this is completely baffling. For the files that don't produce a type I don't see anything printed to the screen. Maybe a NULL value is returned? I wonder if I can check that? But it gets stranger.

At first I thought it was a problem with my for loop. But if I "copy" the files that do give a type, and place the copies in the same directory (i.e. "file.txt" copied to "copy_file.txt"), they DO give a type. So it's not the loop.

I've tried this on a Mac, Windows IIS and Linux, so strange. But I'll see what I find in the error logs.

Again, thanks for the help,

Kevin



Jeff Johns wrote:
Are you not getting anything in return for the files that do not
produce a type?

From the manual:
"Returns FALSE if an error occurs. filetype() will also produce an
E_NOTICE message if the stat call fails or if the file type is
unknown."

Set your error reporting for the script to report all errors to try an
pinpoint what is happening. It is hard to tell not seeing the rest of
the script and your filesystem.

.



Relevant Pages

  • Re: VB Script Error
    ... You can run the script after you have logged in. ... Dim objNetwork ... Set objFileSys = CreateObject ... On Error Resume Next '// disable error reporting (e.g., ...
    (microsoft.public.scripting.vbscript)
  • Re: Report in FM 6 or 7
    ... achieve this report format will have to be done via scripting. ... but they will simplify the script and Sort Order. ... End Loop ... The normal 'Dancer' field is used so that if there are more than one ...
    (comp.databases.filemaker)
  • Re: recreate database script not work
    ... I got a script which is supposed to regenerate database systax. ... REM gen_dbse_9.sql ... end loop; ...
    (comp.databases.oracle.server)
  • Re: Loop Problem (At Least I think)
    ... If there are no images matching the product ... "" Then" statement (the one below the loop, outside of it), is this just ... >> script to finish. ... > 2) Read the database table and acess the dictionary object for the ...
    (microsoft.public.scripting.vbscript)
  • Re: How to set up a global variable in a sub-routine?
    ... the 'global variables' are more like constants ... ... single script, I need a way to tell it only once where the file is and ... So, if you construct a loop with a loop variable, you ... >programmers avoid global variables completely. ...
    (perl.beginners)