Using C fopen in Windows 8 Runtime Component - windows-runtime

I am using a cross-platform library in a Windows Runtime Component (C++) in a Windows 8.1 Store (Metro) app. This library makes C style file calls such as fopen, stat, etc.
These operations work fine when the file is in the local app scope (e.g. in the app's local directory). But if the file is located in other locations (for instance on the "Desktop") then these operations fail. Is there a way to make fopen and other file calls outside the local app folder without having to switch to StorageFile? As an alternative I can only think of copying all files to the local app folder.
Regards,

Related

Windbg symbols for Windows XP

So I have a problem getting symbols (such as ntdll.pdb) for Windows XP x86.
I know that in the past you could download these symbols, but today you can only do this from the microsoft servers like mantioned here
The problem is that my XP machine can't access the Internet. Is there any way to get the symbols offline? Maybe someone here has symbols in "c:\symbols" and can upload them?
Thank you very much
You can use SymChk from a WinDbg package compatible with Windows XP to generate a manifest file on the offline machine, then use that manifest file on another machine with Internet access to download the symbols. Quoting from the Using a Manifest File with SymChk page:
In some cases, you might need to retrieve symbols for files that are on an isolated computer; that is, a computer that is either not on any network or is on a network that has no symbol store. In that situation, you can use the following procedure to retrieve symbols.
Run SymChk with the /om parameter to create a manifest file that describes the files for which you want to retrieve symbols.
Move the manifest file to a network that has a symbol store.
Run SymChk with the /im parameter to retrieve symbols for the files described in the manifest file.
Move the symbol files back to the isolated computer.

Adobe Air Android Debug

I am using Flash Builder 4.6 to develop an Android game using Air. When I debug on PC it works fine, however when I plug in my Android phone and attempt to debug, I get an error with the location of a db file.
This is what I presently have the location set to:
private static var DefaultDB:File = File.applicationDirectory.resolvePath("com/arakaron/Assets/Database/DefaultDb.db");
What / where should I be setting it to? It seems that when I debug the app, nothing gets transferred to the phone as I can't find any Arakaron resources on the phone.
Any help would be great.
Thanks.
You can't access the DB in this way.
Please use below code.
File.applicationStorageDirectory.resolvePath("DefaultDb.db");
Your db has to be within the application storage. If you want to have inside the folder then you define the folder name like below:
File.applicationStorageDirectory.resolvePath("db\DefaultDb.db");
The File.applicationDirectory on Android refers to your application and assets. On Android this is contained packaged in your APK and assets are decompressed in memory by the OS when you access them. You shouldn't use this directory unless you are reading assets from your package. Assets in this directory can only be accessed via a url and won't have a nativePath property.
Most likely you should use the File.applicationStorageDirectory or if the files can be safely deleted without breaking the operation of your application you should use the File.cacheDirectory.
You can read more on these locations: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html
If you package a database with your application you should use the File copy process to copy the file to one of the above locations before attempting to access it as a database.

Can I write file on SD Card

With the new SDK 8.1 of Windows Phone is there a way to write file on SD Card ? Before we could only read. I have an idea to save file from my app on SD Card and this can be interesting for the Lumia 520 who have few memory.
More information about Data and Files you will find in the documentation. And as written here:
What you can access
Your app can only read and write files of file types that the app has registered to handle in the app manifest file.
Your app can also create and manage folders.
So if you had declared File Type Association - there shouldn't be a problem to write/read files.
Note also that your App can be installed on SD Card, then all its files will be located there.

Windows Phone 8 isolated storage

Is it possible to physically copy files to Isolated Storage using the ISETool? I'm trying to add a text file into Isolated Storage and then, through code, check if that file exists. When I do this, I get a "File does not exist" error.
If I add a file to Isolated Storage in code, it works successfully and I can access it in Isolated Storage via the ISETool to copy it to my PC.
Consider scenario 2:
I add a file into Isolated Storage in code, and then using the ISETool get it back to my PC. Without modifying the file, I place the SAME FILE back to Isolated Storage and try to open it through code, I see the same "File does not Exist" error.
You haven't said how you're writing files to Isolated Storage.
Instead, consider using something like Windows Phone Power Tools for this as it makes it much easier to work with files in Isolated Storage.
According to this MSDN article, you are able:
...to replace the files and directories in an app’s local folder on an
emulator or a device with files and directories from your computer....
Steps:
Deploy the app that you want to test to the emulator or a device.
Get the Product GUID for the app specified in the ProductID attribute of the App element of the WMAppManifest.xml file.
Open a Command prompt window and navigate to the location of ISETool.exe.
To replace all the files in the app’s local folder with files from your computer, type the following command using the Product GUID obtained in the previous steps and specify the source directory on your computer.
ISETool.exe rs <xd|de> <product-id> <desktop-path>
The following example shows a command that replaces the files and directories in an app’s local folder with the files from the directory "C:\Data\My Files" on your computer.
ISETool.exe rs xd 11111111-2222-3333-4444-555555555555 "C:\Data\My Files"
Hope this helps!
yes it is possible to copy to and from isostorage of phone or emulator
try this to upload or download files into iso storage
for wp8.1 only
https://isostorespy.codeplex.com/
for wp7
Windows Phone 7 Isolated Storage Explorer
for wp8
Windows Phone Power Tools

WINRT How to declare a file type association for a file without extension

How can i access a file "without" extension in metro application?
Normally you would need to declare the capabilities of the application incl. a declaration which filetype/extension you wanna access, if the file is located in the document library. The problem is the file i wanna access dont have an extension.
Im trying to access some files within a git directory.
Windows has always used the file extension for association with a program. A file without an extension cannot be associated with a program.