I want my application be able to handle any posix-compatible file path. But the only thing I've found after a long time of googling is this bnf. Doesn't look like official and trustful source.
Should I trust the information at the link above? Where can be found more or less official specification?
Definition of pathname
Pathname resolution
The grammar that you linked above, looks good.
Related
This must be a stupid question, because no one else has posted it and the explanation in stardog is very simple. It says 'Stardog Server’s behavior can also be configured via a stardog.properties—which is a Java Properties file—file in STARDOG_HOME.'
I am looking for the stardog.properties file. It is not in the folder I specified STARDOG_HOME to be. In fact, it is not anywhere. I have done a search of the entire computer.
What is going on?
*This question was answered below.
There is no default stardog.properties file which is why you cannot find it. You can create the file yourself in the STARDOG_HOME folder. You can find an example configuration file in the stardog-examples repo.
I need to parse .klc files from msklc and I can't find any docs about it's format.
I know this format is simple, but I have some misunderstanding. So where I can find information about it?
I have found some code in the keyboard layout tool, which might help you. I have pasted it Here. I extracteded it from the exe using il-spy.
Apparently the code parses the klc file for you.
I have not tested it out, but it could serve as a starting point.
I'm using Haxe to make a few simple SWFs for RTMP video streaming. Everything is working great, but what I'd really like to do is tokenize a few properties so that the SWFs are compiled with environment specific properties ALA Ant.
E.G:
var host = "rtmp://localhost:1935/broadcasts";
Becomes:
var host = "#RTMP_ADDRESS#"
And then during compile, the token is substituted with an environment specific value- local.properties contains:
RTMP_ADDRESS=rtmp://localhost:1935/broadcasts
I've poked around in documentation and on forum posts and can't see how to do this, though I'm sure it's possible. Can anyone point me in the right direction?
Note: I considered using flashvars and managing the address in the web application, but that seems less efficient. If that's the better way to handle this please explain why.
It sounds a perfect case to use macros, which is in the nightly build of haxe.
You can create a config file (maybe in xml format) inside your project, and in the body of your macro function you load the file and extract the String, finally return it as an expression.
I am getting file list in my Java program using list() method of File class. When I run my program on Knoppix I get ???? instead of Cyrillic file names. It seems that problem is in knoppix, not java. I tried to use options for mounting file system, such as nls and iocharset, but it has no effect (or may be I use it in wrong way). Somebody can help me?
I think that problem is as you said with Knoppix. Probably you do not have Cyrillic font bundled, so there is no way to display these code points.
If you want to fix this, you will need fix distribution, as there is nothing wrong with the program. I am not sure if this is the question for https://serverfault.com/ or https://superuser.com/, but you can read their FAQ's and ask how to fix it there (probably you will need to re-create Knoppix distribution).
I need to inspect the bits of an uploaded file before it's ever saved off to the file system. PHP's documentation has a nice page that tells me exactly what properties are available for me to use (http://us3.php.net/manual/en/features.file-upload.post-method.php), but I can't find something similar for Ruby and/or Rails.
I've also tried logging a JSON-formatted string of the upload, but that just gives me a redundant UTF-8 error. I can't think of anything else to try.
Can anyone offer any insight or point me to the right place?
Thanks.
UPDATE: I'm running Apache 2.2.11 on OS X (Leopard) in case Peter is right (see below).
UPDATE: In case it helps, my input parameter is logged as "upload"=>#<File:/tmp/RackMultipart.64239.1>. I'm just not sure how to access it to get to its "parts".
As far as I've been able to tell or find, there is no physical file until an upload is read. This is inline with derfred's reply. The only metadata that can be accessed is:
uploaded_file.content_type # the uploaded file's MIME type
uploaded_file.original_path # which is really just the name of the file
Additionally, there's a read method on the uploaded_file that allows the file' content to be accessed and, presumably, written to the permanent file system.
Something else that I've noticed is that the only means Ruby offers to inspect the MIME type of a file is in this content_type property of an uploaded file. Once the file is on the file system, there's no longer any way of accessing or determining the MIME type.
I think this depends on the web server you're using. I remember having different fields for mongrel, apache and nginx.
AFAIK Rails and the various app servers totally abstract the upload part. However here is a thorough discussion of the topic:
http://www.jedi.be/blog/2009/04/10/rails-and-large-large-file-uploads-looking-at-the-alternatives/
This is just a File object, something that you can duplicate by going:
File.open("some_file")
The /tmp/RackMultipart.64239.1 is just a filename.
If you want to see/output its contents from the controller:
puts params[:upload].read