Tag: API

Maximum number of characters in a Windows path is 260 characters

A Java project compilation went berserk and I ended up with a directory structure of more than 260 characters. I stopped the mad process but it already created more than 50 successive duo of path “build/classes” …

Duo of build/classes directories in path created by Netbeans

Now I had to delete this structure. And, to my surprise, it was impossible. When you try to just press the “Delete” key with the root directory selected in the File Explorer, you get a Path Too Long exception. The reason is that the maximum length of a path according to the Windows API (MAX_PATH variable) is defined as 260 characters. I tried some other methods but all of them failed:

  • write a small Java program that tried to delete the whole path: Netbeans (Java) was able to create this mess, why shouldn’t another Java program be able to delete it? Impossible.
  • write a small C++ program that tried to delete the whole path: as long as you stick with the Windows API, it’s impossible (I read that it could be possible using the boost::filesystem library but didn’t try).
  • try some Portable Apps utilities for file management: impossible (even when the software was using another framework like Qt).

Finally, I just ran a Cygwin terminal, went to the ad hoc location and did a simple “rm -rf libtest“. And voilà. So, next time Windows forbids me from doing something, it might be a good idea to directly rely on a true terminal from a Unix-like environment. I didn’t try a liveCD (I didn’t have such CD to hand) but it might be also possible.

Google+ API started

Logo Google PlusGoogle+ (G+) is a social networking and identity service operated by Google. It started a few months ago like a closed service from where you can’t get out any data and where the only possible interaction (read/write/play) is only possible via the official interfaces (i.e. the web and android clients). Google promised to release a public API and it partly did so tonight, here.

As they stated, “this initial API release is focused on public data only — it lets you read information that people have shared publicly on Google+” (emphasis is mine). So you can already take most of your data out of G+ (note that it was already possible to download your G+ stream with Takeout from the Google Data Liberation Front). As usual, it’s a RESTful API with OAuth authorization. It comes with its own rules and terms (it could be interesting to add to GooDiff). The next step would be to be able to directly write something on Google+.

I only tried to try the examples so far. But unfortunately I got an authorization error. I won’t go further for tonight but their error screen is interesting 🙂

Error 400 screen - Bad request - Google+ API

OpenSocial, a step further towards a "society of social networks"

Since Thursday, Google Code is hosting the OpenSocial project, a group of APIs allowing the development of common software for a certain number of “social networking” websites (e.g. LinkedIn, MySpace, Ning, Orkut, …).

Before Thursday, every programmer wanting to develop a software for social networks had to learn an API, how to write code and sometimes a new language for each of these networks (when these ones exposed a public API!). Now, OpenSocial gives access to the most common functions of all the participating networks. Currently, the API gives access to:

  • the users profile information
  • the networks and friends information
  • events in the network

One advantage of OpenSocial is that it’s based on existing languages (Javascript, HTML and Flash) where other APIs (the Facebook one, to be clear) impose a new language like FBML. Source code for examples is under a free license as well as all the documentation. OpenSocial promises to open the API source code soon (see the FAQ).

Finally, one slowly achieves a true social networks society (federation) where, whatever website/network you are registered, you’ll be able to use the same applications (who spoke of standardization?). Web 2.0, software are coming!

Now, some questions remain unanswered …

  • One day, one can be registered in a network and access other networks without being registered with them (a bit like gateways allow people using one type of IM can chat with friends using another type of IM).
  • What about security, access to data (from outside) and the public perception about this? (see Bruce Schneier’s opinion on Facebook and data control)

I initially wrote this news in French for LinuxFr (see here).