QueryCAT Logo
Search 5,000,000+ questions and answers.

Frequently Asked Questions

Can I read and write files from a kernel module?

Unofficial comp.os.linux.development.* FAQ
Yes, but it is a little tricky. You should not use the usual user space functions open, read, write, and close. Instead you should use filp_open and the methods in the returned struct. Always remember to cleanup after yourself. Here is an example: (FIXME: Put the updated version here) kcp.c. If you need more examples I suggest you take a look on the sourcecode for the khttpd or tux webserver. Always remember that file access is only possible in a process context.

Q10: How do I check out a module with read-write access?

CDCVS FAQ
business for the checked out module. You shouldn't have to type it again to do updates, commits, etc.

How can I read/write structs from/to data files?

Infrequently Asked Questions in comp.lang.c
Loop with putchar. Be careful; if your machine uses signed chars by default, all of the sign bits in your structure elements will be reversed. [a]

What are these 7.04/7.05 kernel files?

DOS FAQ by Christoph Fuchs
These files are OEM versions of Ontrack. They have got a big bug: an error occures when you want to rename a file. The IBM*.COM files nativly support the new partition type 0Fh (LBA). It's not recommended to use these files if you don't know what you do. The COMMAND.COM file seems to be okay, but I didn't notice any changes.

Why did you write a new kernel module? What's wrong with CODA, UserVFS, etc?

The Zero Install system
Fully user-space filesystems are really, really slow. Fine for accessing a remote FTP site, but you wouldn't want to run all your applications that way. Every file read involves a context switch to another process and back! CODA is better (and was used for prototyping), but it's still slower than lazyfs (double context switch on every open/close) and buggy. Also, if the user-space helper crashes, all your applications stop working and you probably have to reboot.

How do I read/write files?

JavaScript - Frequently Asked Questions - CodingForums.com
Pure client-side JavaScript cannot write files to the server because it simply was never intended to and moreover, that's what server-side languages are used for. Perhaps there are security reasons among others for this as well. for reading files with JavaScript, this is completely possible and done quite easily if you use something like Vlad's script or David's script.

I need to read/write files. How do I find the correct path for my site?

hsphere faq
The correct way to do this would be using Server.MapPath. This would map the virtual path to a physical location on the disk. Ex. If you have a file in your root web called visitor.txt and you use Server.MapPath("/visitor.txt") and the physical path to you root web was "F:\webs\yourweb" then it would return: "F:\webs\yourweb\visitor.txt" If you use this method you should never have to worry about the physical paths.

How can I read/write structures from/to data files?

Structures, Unions, and Enumerations
It is relatively straightforward to write a structure out using fwrite: fwrite(&somestruct, sizeof somestruct, 1, fp); and a corresponding fread invocation can read it back in. What happens here is that fwrite receives a pointer to the structure, and writes (or fread correspondingly reads) the memory image of the structure as a stream of bytes. The sizeof operator determines how many bytes the structure occupies.

When I read and write graphics files they have errors. Why?

REBOL Language FAQ
Be sure to use the /BINARY refinements on READ and WRITE when dealing with binary data such as graphics, programs, compressed data, etc. data: read/binary http://web.page.org/pic.jpg write/binary %some-pic.jpg data If you don't, the file will be read as a text string, and any bytes that appear to be line terminations (CR) will be converted or deleted.

How can I read and write from a database?

FAQ - iMacros
Database integration is very easy with iMacros thanks to its powerful Scripting Interface. iMacros can connect to any Windows database, for example Access or SQL Server, but also MySQL. The Scripting Interface can be used from any Windows programming or scripting language like Excel VBA, Foxpro, Perl, C, C++, Java with no problems. Please see the following example scripts: "extract-2-file.vbs" (uses wsh-extract-and-fill-part1 and wsh-extract-and-fill-part1 macros) "extract-2-database.

What is the difference between a kernel thread and a kernel module?

Unofficial comp.os.linux.development.* FAQ
A kernel module is a piece of code placed in the kernel address space. This is similar to shared libraries. The module can contain data and code as you wish. Being in shared memory the module and it's code can be accessed by any thread in kernel mode. When the module is loaded a special initialization function will be called and should quickly return success or failure. Before the module is unloaded an optional cleanup function is called, this must do whatever cleanup needs to be done.

Can I start kernel threads from a kernel module?

Unofficial comp.os.linux.development.* FAQ
Yes you can do that. Most modules don't need to create any kernel threads. If you are writing a driver and think you need a kernel thread you could easily be wrong.

How can I read signal files?

Frequently Asked Questions about PhysioNet
If you would like to read signal files within a C, C++, Fortran, Java, Perl, or Python program, see the WFDB Programmer's Guide for information on doing this using the WFDB library. Other programming languages supported by SWIG may also be usable with the WFDB library, but have not been tested. Briefly, use isigopen() to open the files, and getvec() to read them.

How can I read annotation files?

Frequently Asked Questions about PhysioNet
If you would like to read annotation files within a C, C++, Fortran, Java, Perl, or Python program, see the WFDB Programmer's Guide. Other programming languages supported by SWIG may also be usable with the WFDB library, but have not been tested. Briefly, use annopen() to open the files, and getann() to read annotations from them.

How do I read the download files on this website?

Frequently Asked Questions (FAQs)
pipe-delimited text (.txt) format files (OTCBB Symbol Directory, Daily List, Monthly Share Volume, etc.); self-extracting ZIP (.exe) files that expand into pipe-delimited text format files (Monthly Share Volume Report, Market Maker List, Other-OTC Symbol Directory, etc.). This information will need to be saved to your computer. Select File from the menu bar, then select the Save As... option You can now import the data into a spreadsheet or database.

Why are some files in PDF format, and how can I read them?

FRB: FAQs
Adobe's Portable Document Format (PDF) reproduces the exact look of a printed page and is used for documents that could not be readily deployed in hypertext markup language (HTML)--the "typeset" format that is designed for web browsers--or in the plain "typewriter" text of ASCII (American Standard Code for Information Interchange). Also, the document may be offered in PDF along with one or both of the other two formats.

Why are there three files for every module, why not just one?

NASA GISS: GISS GCM ModelE: FAQ
There are generally three logical parts of each module: a common block (that owns the variables on the main model grid and/or saves output from a module that might be used by another part of the code), the local physics (for instance, the pure 1D column physics) and the drivers (the programs that access the local physics routines, do initiallisation etc.). The reason that they are in seperate files is mainly because of the logical dependencies between the main model and module variables.

cvs commit Q4: How do I give a group of users permission to write to a module?

CDCVS FAQ
A4: Place the line #include group where group is the name of the group alias constructed for this purpose.

How i can get read and write access to ntfs files system from fedora?

Fedora For Newbies
Fedora kernel has module for read and write access to the ntfs file system, that should be enabled, now the easy way for installed kernel is to install the kernel version ntfs modules get the lates fedora core 5 kernel ntfs moudle from here or use the yum to install the module:

Can I read/write ascii text files with the AID language?

Answers to Questions
Yes, Unibase by DMAC does allow read/write of ascii text files with the AID language. These text files must be in the "text" sub-directory under the ETROOT. They may NOT have an extension in the name. Sub-directories may exist under the "text" sub-directory.
More Questions >>

© Copyright 2007-2012 QueryCAT
About • Webmasters • Contact