Question: I'm attempting to read a file's datemodified value, but I've been unable to do so. I'm continually receiving "Inappropriate I/O control operation" errors. This is a windows directory structure that I'm attempting read. I've attempted to pass through the full file-path along with the file name ($outputFilePath."/".$files) to the stat() function ($! returns nothing in this case, program simply dies), as well as using a file-handle (below) with no results. Any help is appreciated. 

```
chdir($outputFilePath);
opendir(my $dirHandle, $outputFilePath) or die "Cannot opendir $outputFilePath: $!";
my $files;
my $modTime; 
#print getcwd();
while($files = readdir($dirHandle)){
  if($files ne '.' && $files ne '..'){
    open(my $fileHandle, $files) or die "Cannot open $files: $!";
    $modTime = (stat($fileHandle))[9] or die "Cannot stat file $files: $!";
    print $files."-".$modTime."\n";
    close($fileHandle);
   }
}
closedir($dirHandle);

```

Answer: 
Here's a slightly different approach - doesn't need the character types. Uses multiplication as a bit shifting technique. I wrote it so it will still work when str.length is not a multiple of 4 - but you did in fact state in your question that it would be...

Note - I did not try to do "clever coding" - so I made sure things were explicitly assigned, one statement at a time, ... You can probably come up with a more compact way to achieve the same thing. This should give you some inspiration though.

```
function stringToIntArray(str) {
  var l = Math.ceil(str.length/4);  // not needed if you are sure it's a multiple of 4
  var opArray = new Array(l);       // known length - miniscule speed advantage?
  var ii=0, jj=0, charCounter=0;    // ii loops over 4-char word-of-interest
                                    // jj counts elements in the output array
                                    // charCounter points to the current character
  opArray[0]=0;
  while( charCounter < str.length ) {
    ii = charCounter % 4;     // count 0, 1, 2, 3, 0, 1, 2, 3...
    opArray[jj] *= 256;                 // left shift 8 bits
    opArray[jj] += str.charCodeAt(charCounter);  // add next code
    if(ii==3) {
      opArray[++jj]=0; 
      }
    charCounter++;
  }
  return opArray;
}

var myval = stringToIntArray("deadbeef");
alert("'dead' turns into " + myval[0] + "\n'beef' turns into " + myval[1]);

```

Output:

```
'dead' turns into 1684365668
'beef' turns into 1650812262

```

Result is as expected; doesn't require HTML5 compliant browser; and is big endian.
How about <https://github.com/vjeux/jParser> - This library looks promising.